Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

rmurdo on "SQL result next to menu name"

$
0
0

Hi all, I have a small plugin that has some records stored in sql. What I need its to do this:

In the admin section of WP on the left side I see my plugin link to the settings page. You know how some plugins have a red circle with a number in it? Like items waiting to be monitored?

I would like to do with. I know the SQL to get the result but am not having much luck getting to work in the plugin. Does anyone have an example on how to do this?

Thanks!


bogdanUlea on "Hacked code inserted in all the php files from my website"

$
0
0

Hi,
I have the following problem:
All my .php pages from my website has been hacked. A suspicious code has been inserted on first line of my WordPress website. I have changed all the user access password and database passwords and users and installed a new version (the last version 3.9.1)...It is very strange. The php files from my installation have 0644 rights access on Linux. The hosting is offered by hostmonster.com.....I think is something with their security access. Did somebody had the same issue?

The inserted code is:
[removed]

martin on "disk usage growing (Hacked?)"

$
0
0

I am not doing anything to my wordpress site but the disk space usage shown in the cPanel is growing simultaneously, growing hour by hour. (my site is 2xxmb in size for a long time, because each blog is about 3 mb to 5 mb, But the site was 3xxmb last night and is >440mb at this moment)

The stuff which is growing are:
1. MySQL database (from about 15mb to 60mb)
2. this directory: ".cagefs"

What should I do, I think I maybe hacked.

dubcznic on "WP_EDITOR on Frontend in bootstrap modal doesnt work properly"

$
0
0

im stacked on one problem. in my plugin, i open a bootstrap modal and inside it i want to display the defaul WP editor, called by the function wp_editor(). What i get is the textarea with buttons and the button ADD MEDIA, like it displays in admin section. but i cant put focus on the textarea, and its giving me JS error in console when clicking the ADD MEDIA button, or trying to put focus. it acts like an input with "disabled" attribute. When i display the editor with the same code but NOT IN MODAL, its works well.

the code i use is:

$settings = array(
    'textarea_rows' => 20,
);
wp_editor('<p>Some more content</p>', 'textareasaaaaaaa', $settings);

and the HTML structure of bootstrap modal (not iframe):

<div style="display: none">
    <div id="designizer_ajax_dialog_confirm_delete" class="modal fade dialogWindowWrapper">
        <div class="modal-header">
        </div>
        <div class="modal-body">
        ...

i made a video here for better inside view: http://screencast.com/t/Lyc3ANzqu
here you can see that it works when not in modal: http://screencast.com/t/yA2CvLFTAM

Do you have an idea how to make it works? maybe some DOM problem with initialization? Thanks for any info.

// i use bootstrap modal for its multi-modal open, which allows me to have 3 modal open f.e.

Jacob N. Breetvelt on "WP_DEBUG and PHP version"

$
0
0

Under PHP 5.3 when WP_DEBUG is true, error_reporting is set to 30711 by WP
Under PHP 5.6 when WP_DEBUG is true, error_reporting is set to 32759 by WP

I am very sad about this, and it almost prevents me to go to version 5.6, because of the 'strict' error messages being generated by many plugins...

Is there ( where is... ) a way to set the error_reporting value of the debug mode?

bouinfrederic on "query_posts alternative"

$
0
0

Hi there,

I am creating a website that integrates a portfolio which uses custom post types, this was done based off of this tutorial.

So far it is exactly what I am looking for and works great except for one small detail. In order to fetch the posts from the new custom post type the author of the tutorial used the query_posts() codex. So the top of my portfolio page looks like this:

<?php
/* Template Name: Portfolio */
get_header();
query_posts('post_type=portfolio&posts_per_page=10');
?>

What I gather is that this declares "get posts from "post type" portfolio and show 10 per page". My problem is that I can't go get content from my portfolio page. It seems that now my portfolio page only fetches the content from the custom post type, and I can't use:

<?php while ( have_posts() ) : the_post(); ?>
  <?php the_content(); ?>
<?php endwhile; // end of the loop. ?>

to get content from the actual page.

Any ideas how I could modify this? I am also still learning so being clear with explanations would be greatly appreciated.

Thank you!

mikeill on "Check if Twitter Bootstrap is already loaded"

$
0
0

Developing a plugin that uses Twitter's Bootstrap Modals, but would like to prevent loading bootstrap if it's already loaded.

Apparently the following .js code could do the trick:

<script> if(typeof($.fn.modal) === 'undefined') {document.write('<script src="//www.mysite.com/js/v/bootstrap-2.1.1.js"><\/script>')}</script>

But is there any way of doing it with php, or otherwise preventing the plugin from encoding the script if it's already present?

PerryDS on "Change title from Ultimate word cloud selection"

$
0
0

on this site ... http://www.differentiatedinstruction.ca, when you select an item under Search by learning format (uses portfolio project attributes), it comes up with a title "Project Attributes Read & Reflect".

I just want it to say - Read & Reflect, I don't want "Project Attributes" in the title ...

It uses the ultimate tag cloud widget ...


ppwuq4 on "Need admin response"

$
0
0

I have an urgent private concern that I would rather not share openly. It has to do with the security regarding WordPress. Will an admin please message me in private?

DenisCGN on "Custom META in wpSEO plugin"

$
0
0

Hello,
I use the wpSEO plugin. And it offers the possibility to change the meta via a function.

This is the function:

add_action('init', 'set_wpseo_meta');

function set_wpseo_meta() {
    apply_filters(
        'wpseo_set_meta',
        array(
            'title' => 'Neuer Titel',
            'desc' => 'Neue Description',
        )
    );
}

When I use it with static data it works well. No I like to have custom fields and taxonomies be used for creating the meta.

This is how I get my dynamic meta.

global $wp_query;

$artists_list = wp_get_object_terms( $wp_query->post->ID, 'mhq_artists' );
$label_list = wp_get_object_terms( $wp_query->post->ID, 'mhq_labels' );
$cdTitle = get_post_meta( $wp_query->post->ID, 'my_meta_box_Title', true );
$cdRelease = get_post_meta( $wp_query->post->ID, 'my_meta_box_dateRelease', true );

foreach( $artists_list as $artists )
$artist_names[] = $artists->name;

foreach( $label_list as $labels )
$label_names[] = $labels->name;

$artist_names = implode( ', ', $artist_names );
$label_names = implode( ', ', $label_names );

Now, how do I get this dynamic into the function?

When I try to change the variable with the static text I got an error.

And, I like to have this all, only if(is_single()).

Can someone tell me how this works?

Cheers,
Denis

GuardianAngel on "Custom link for image?"

$
0
0

Hi!

I have begun playing with writing plugins and widgets and I have a problem...

I want to create a plugin the let's me link an image with a URL but this URL is generated using information I must fill in (ie or affiliate links and the like).

I don't know how to go about this...

essentially I want to do something that let's me do something like this

<a href="bla bla bla"><img src="test.png"></a>

"bla bla bla" is generated from information I must fill in and, hopefully, I would like to see be able the preview the image wrapped in this "link" in the visual editor...

What should I look at to be able to do something like this? I don't know what's available in WordPress programming wise to do this...

Thank you!

Nick

richesnrags on "need to code a button to act as a form submission button"

$
0
0

hello I need some instruction I am a novice coder, I can open the files and add the code as long as I know where and what to add. I am using gravity forms on my site. the user fills in the form on page A the data is transferred via query string to page B which has a hidden form and then the data is passed to page C which has a visible form. I need to program a button on page B to act like the submit button on the hidden form so the data will be passed. this is what I got from gravity forms support

You can use jQuery to submit the form when your button is clicked, either add the following to your button onclick attribute or wrap it in a click handler ( http://api.jquery.com/click/ ) bound to your button
jQuery('‪#‎gform_13‬').submit();

can someone explain how to do this? currently the button on page B is an image that redirects to page C when clicked

maxxd on "Custom menu walker question"

$
0
0

Hey all. I'm fairly new to WordPress (not php) and completely new to this forum, and am running into an issue. I need to add link descriptions to 1 of 5 menus on my page. I've read about extending Walker_Nav_Menu() and am attempting that, and it's kinda going well except for one slightly annoying issue - it's returning the wrong menu.

I'm attempting to isolate the action to a menu with the slug 'subbrand-menu'. All the code follows:

mytheme/functions.php

require_once('classes/FunctionClass.php');
$fn = new MyDev\FunctionClass();
add_filter('wp_get_nav_menu_items',array($fn,'buildSubbrandMenu'),10,2);

mytheme/classes/FunctionClass.php

namespace MyDev;
class FunctionClass{
        private    $_walker;
	public function buildSubbrandMenu($menu, $args){
		 if(\is_admin() || $args->slug !== 'subbrand-menu'){
			return $menu;
		 }
		if(empty($this->_walker)){
			require_once('MyWalker.php');
			$this->_walker = new MyWalker;
		}
		\wp_nav_menu(array(
			'menu'			=> 'subbrand_menu',
			'container'		=> 'div',
			'container_class'	=> 'menu-subbrand-menu-container',
			'container_id'		=> '',
			'menu_class'		=> 'menu',
			'menu_id'		=> 'menu-subbrand-menu',
			'echo'			=> true,
			'walker'		=> $this->_walker
		));
	}
}

mytheme/classes/MyWalker.php

namespace MyDev;
class MyWalker extends \Walker_Nav_Menu{
	public function end_el(&$output, $item, $depth=0, $args=array()) {
		$output .= "<span class='thisisadescr'>Testing, testing</span></li>";
	}
}

Now, the above actually works quite well except that it's outputting the contents of a menu with the slug 'floater'. Of course, the hard-coded 'descriptions' are attached to each menu item, which is good in the long run...

Anybody have any ideas what I'm missing here? I'm sure it's something simple but it's driving me crazy right now. Thanks in advance for any and all thoughts, hints, tips, and ideas.

belindajohnstone on "Display an Author Page on Author Dashboard"

$
0
0

I'd like an author to be able to login and see their published page and posts. (but not be able to publish more pages)

Currently even though the author has published a page it's not showing in the dashboard.

Any advice greatly appreciated.

Thanks!

webmandesign on "Action and filter hooks names (tags)"

$
0
0

I've recently run into an issue with the same name for action and filter hook. I'd like to ask whether it is not possible to use the same name (or "tag") for action if the name is already used with a filter. Example:

apply_filters( 'custom_name', $var, $atts );
do_action( 'custom_name', $atts );

In this case there is a PHP warning "Missing argument 2..." thrown out when some function is hooked into the custom_name filter (the function is perfectly fine with 2 parameter variables in function definition).

Thanks for the answer!

Oliver


acrane on "is_tree not working as expected"

$
0
0

Has anyone run into the problem with the is_tree function that having an else will not work? If I delete the last else statement so that it cannot take on a last variable, it works as expected.

if (is_tree(33)) {
 	$logoClass = 'logo-yellow ';
	$nav = "conway";

} elseif (is_tree(35)) {
	$logoClass = 'logo-red ';

} else { // if is something else
	$logoClass = 'logo-blue';
}

I am using both
<?php wp_reset_query(); ?>
<?php wp_reset_postdata(); ?>

before the call.... trying to make sure a query isn't interfering.

javihashtag on "Adding repeatable fields used in Widgets - sidebar?"

Fi Fi P on "Featured image"

$
0
0

I have continually found this a problem and no clean, simple answers.
For my site, I want all of my standard pages to display the featured image full width at the top of the page.

I have added the below code to my functions.php file:

if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'band-top' );
set_post_thumbnail_size( 1000, 300, array( 'center', 'top' ) );
}

I then regenerated my thumbnails and on my page.php I have inserted the below where the image is to appear:

<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail('band-top');
}

In my CSS, to keep it responsive:

#content-area img {
width: 100%;
}

My problem is the height of my image. I want it to be 300px high without distorting the image so all featured images will appear the same size and be cropped from the top.

Any help would be great!

rahjiggah on "add posts from custom form that is not attached to wp?"

$
0
0

Hello,

I have an application outside of wordpress and was wondering if after I process data on a form if I can add the data relevant data to a wordpress site?

ie conn to wp db and make a post on the wp-site...

Just wondering if theres a quick answer
(besides google which hasnt really worked for me)

Thank you.

capecodvalet on "Using Media Uploader for custom meta field"

$
0
0

I'm writing a plugin and want to have a custom meta field that is a list of media images (essentially a gallery). Seems to me that using the media uploader in gallery mode makes the most sense (why invent the wheel, you know?) I've seen some tutorials and docs for uploading single images, but haven't found anything yet for multiple images. I would like to be able to both upload and edit the images & order.

Can anyone point me to API docs for this, or do I have to look through media.php or other WP core files to figure it out?

Thanks!

- Fred.

Viewing all 8245 articles
Browse latest View live


Latest Images