Hook up MU site creation
You can use wpmu_new_blog action hook which accepts 6 arguments: $blog_id $user_id $domain $path $site_id $meta
You can use wpmu_new_blog action hook which accepts 6 arguments: $blog_id $user_id $domain $path $site_id $meta
Can you not simply use the_content filter hook? function mytheme_content_filter( $content ) { // Do stuff to $content, which contains the_content() // Then return it return $content; } add_filter( ‘the_content’, ‘mytheme_content_filter’ );
init is too early for conditional tags, use template_redirect instead. have a look at the action reference to see the order they’re executed.
Shot in the dark here, but… It is entirely possible the plugin with the do_action definition is hooked before the theme is processed. Find out where the do_action is defined, and find out when it is being hooked. You might need to hook to the function that the do_action definition is hooked too, and THEN … Read more
Not really, attachments are still not “full post types”. Manny Flerumond hints this quite well in this thread: Was thinking about this the past few days: currently any media files uploaded to a WordPress site defaults to the post status of inherit, which is a holdover to when media attachments were just that. Media was … Read more
So far as I am aware, there is no hook in the location you need, if I understand you. The closest I can think of is loop_start, which as you might expect runs when the loop begins. The problem with that hook is that you don’t know what content the theme may have between the … Read more
I just went through this whole process myself. There isn’t a hook or anything to make this easy, so instead we have to “hack” it into place in order for it to work. It’s not pretty, but it gets the job done. I’ve been using it for months now with 3 custom fields and it’s … Read more
This is the solution from Peter Baylies (Plugin Author) add_filter( ‘option_aioseop_options’, ‘itdge_sitemap_addl_pages’ ); function itdge_sitemap_addl_pages( $option ) { if ( !empty( $option ) && !empty( $option[‘modules’] ) && !empty( $option[‘modules’][‘aiosp_sitemap_options’]) ) { $my_sitemap_entries = Array( ‘/test1’ => Array( ‘prio’ => ‘0.1’, ‘freq’ => ‘daily’, ‘mod’ => ‘2014-04-01’ ), ‘/test2’ => Array( ‘prio’ => ‘0.3’, ‘freq’ … Read more
You can hook into wp_enqueue_scripts very late, using the priority argument of add_action. For example: function hook_really_late() { echo ‘Should reasonably be last’; } add_action(‘wp_enqueue_scripts’,’hook_really_late’,PHP_INT_MAX); PHP_INT_MAX should be the highest number assignable as a priority. It is possible that some other code uses the same trick though. That is still probably what I’d recommend. If … Read more
Possibly you’re trying to use that code in a non-admin page. The functon get_plugins is only available on admin side and if you ant to use it somewhere else you have to load the file “plugin.php” manually. To solve this error add that check at the beginning of your function: if ( ! function_exists( ‘get_plugins’ … Read more