Making an add_filter() call from within an add_filter() call

You can add or remove hooks from inside other hooks if you get the timing right but I don’t understand why you are making this so complex. function set_title($title) { global $wp_query,$post,$address; $address = $wp_query->query_vars[‘address’]; if ($address) { return $address; } } add_filter(‘wp_title’, ‘set_title’); If you need the share the value, use a static variable: … Read more

Filter / add_action to upgrade.php page

Well, the first lines of that file, not counting comments/headers, are… /** Include user install customize script. */ if ( file_exists(WP_CONTENT_DIR . ‘/install.php’) ) require (WP_CONTENT_DIR . ‘/install.php’); You could include a custom install script with the rest of your code. That seems the most straightforward approach to me. It is hard to say a … Read more

add after content don’t work

wb_posts_pagination() seems to be a custom function that sends its output directly to the browser with echo or print. Use a function that returns a string and does not create output to add that string to $content. The printed output doesn’t wait, it goes into the page the moment you call that function.

Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )

manage_{$taxonomy}_custom_column is a dynamic hook, so until you are using a proper value for $taxonomy like post_tag, it would work perfectly. Adam Brown page tells it as deprecated because it looks for exact match, while there is a change in the files so the current hook being used are manage_{$this->screen->taxonomy}_custom_column or manage_{$screen->taxonomy}_custom_column which accepts the … Read more

What is the action or filter for adding information under the Permalink in Edit Post/Page?

You can try the edit_form_after_title action: add_action( ‘edit_form_after_title’, function(){ echo ‘<hr/><div>My custom HTML</div><hr/>’; }); to add your custom HTML after the permalink: It will inject the HTML between div#titlediv and div#postdivrich: <div id=”post-body-content”> <div id=”titlediv”>…<!– /titlediv –> <hr><div>My custom HTML</div><hr> <div id=”postdivrich” class=”postarea edit-form-section”>…</div> … </div> Tip: when you have question like this, best thing … Read more

Renaming wordpress login and get new password button

This is a bad idea for general usage plugin, unless you intend to supply translations for all the languages for which there is a wordpress translation. If you need a new login form then use new strings for the text, don’t override the string used in the wordpress login form, it give you no advantage … Read more

custom gallery filter with image caption as link title?

I found a working solution on the WordPress Forums. Here’s the code: function add_img_title_to_anchor($content) { /* Find internal links */ //Check the page for linked images $search=”/<a ([^>]*?)><img ([^>]*?)\/><\/a>/i”; preg_match_all( $search, $content, $matches, PREG_SET_ORDER); //Check which attachment is referenced foreach ($matches as $val) { // Only if the Link doesn’t already have a Title attribute, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)