“admin_enqueue_scripts” hook or $_GET[‘page’]?

The advantage of using the value provided by WordPress in the hook variable is future compatibility with WordPress Versions and not having to worry about $_GET variable manipulation by way of the user or another WordPress plugin. Checking the $_GET array works, but can be unreliable especially when other poorly coded plugins start messing with … Read more

Alternative to new_to_publish Hook for Custom Statuses

new_to_holding doesn’t exist as a post status transition – you need to use the generic transition_post_status action. Something like (untested): add_action(‘transition_post_status’,’my_holding_function’, 10, 3); function my_holding_function( $new_status, $old_status, $post ) { if ( ‘holding’ == $new_status ) { // do stuff } }

Theme not calling Jquery properly

If you register a script with wp_register_script() it is not neccessary to pass all the options in wp_enqueue_script() again. You can register the script in a central place and use the enqueueing it in diffenrent files. functions.php wp_register_script( ‘theme_script’, ‘path/to/script.js’, array( [dependencies] ), ‘1.0’, true ); […] if ( $condition ) require_once ‘file1.php’; else require_once … Read more

WordPress’s “Text” Format

Text its just plain text, just as its saved in your db. WordPress changes line breaks with paragraphs with the function wpautop, through the filter the_content and the_excerpt. If you need to remove the wpautop behavior, you can remove the filter by doing this in your theme’s functions.php: remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ … Read more

why the same code got different results when using query_posts in functions.php and index.php

In your first code example, you hook into the pre_get_posts action, which fires during the main query. But instead of manipulating that query, you trigger another one using query_posts(), which fires the hook again, and you end up with an infinite loop. With the second code example, you’re just overriding the main query after it’s … Read more