How can I enqueue protocol relative external (//ajax.googleapis.com/…) scripts?

The code you posted works fine and results in this in the HTML output: <script type=”text/javascript” src=”https://maps.googleapis.com/maps/api/js?sensor=false&#038;ver=3″></script> Tested on WordPress 3.5 with this code snippet: add_action(‘wp_enqueue_scripts’, ‘test’); function test() { wp_enqueue_script(‘google-maps’, ‘//maps.googleapis.com/maps/api/js?&sensor=false’, array(), ‘3’, true); }

Marking future dated post as published

Awesome combining both the answers from Mike and Jan I came up with this which works only on the post type in question. We don’t need the conditional of show because the ‘future_show’ hook only grabs the post type of show and updates that. <?php function setup_future_hook() { // Replace native future_post function with replacement … Read more

What is theme-compat?

The theme-compat directory is comprised of a set of deprecated (since WordPress 3.0) files that WordPress used to use as fallback template-part files, in case the active Theme failed to include them. In other words, if a Theme used the get_header() template tag, but failed to include a header.php template-part file, WordPress would fall back … Read more

How do I make script load after jquery?

You have a typo in your code. It should be: function load_my_script(){ wp_register_script( ‘my_script’, get_template_directory_uri() . ‘/js/myscript.js’, array( ‘jquery’ ) ); wp_enqueue_script( ‘my_script’ ); } add_action(‘wp_enqueue_scripts’, ‘load_my_script’); The jQuery dependency needs to be an array(), not just a string. This will force your script to load after jQuery.

Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?

The best place to flush rewrite rules is on plugin activation/deactivation. function myplugin_activate() { // register taxonomies/post types here flush_rewrite_rules(); } register_activation_hook( __FILE__, ‘myplugin_activate’ ); function myplugin_deactivate() { flush_rewrite_rules(); } register_deactivation_hook( __FILE__, ‘myplugin_deactivate’ ); See the codex article Apologies in advance, I didn’t make it all the way through your question, so this is a … Read more

How to allow editor to edit privacy page / settings only?

Editing the privacy policy page is restricted to manage_privacy_options as pointed out in a comment in the WordPress core file wp-includes/capabilities.php: /* * Setting the privacy policy page requires `manage_privacy_options`, * so editing it should require that too. */ if ( (int) get_option( ‘wp_page_for_privacy_policy’ ) === $post->ID ) { $caps = array_merge( $caps, map_meta_cap( ‘manage_privacy_options’, … Read more