WP API V2 returning Invalid User ID
Wordfence blocks the User endpoint from the public. In settings there is a checkbox you can unselect to make it visible in the WP Rest API again.
Wordfence blocks the User endpoint from the public. In settings there is a checkbox you can unselect to make it visible in the WP Rest API again.
The first step is setting up the cron job. The second part requires querying the database for a specific post type where the entry is older than 1 week. We can do this with get_posts() and specifying the category argument and the date_query argument. //* If the scheduled event got removed from the cron schedule, … Read more
That button sends an AJAX request that runs wp_ajax_destroy_sessions(). It’s not really abstracted in such a way that you can re-use it outside of AJAX, but if you copy the source into your own function, minus the JSON parts, then you could perform the same action yourself. The key part is this bit, which will … Read more
You can put your code in a plugin, then create a REST API endpoint. For example lets create a plugin, just put a PHP file wp-content/plugins/ahmedsplugin.php or wp-content/plugins/ahmedsplugin/plugin.php with a comment in it at the top like this: <?php /** * Plugin Name: Ahmeds Plugin **/ … your code goes here … Now you’ll see … Read more
Since WooCommerce 3.2, Woocommerce shortcodes and their available attributes have changed. So try the following shortcode instead (for “foo” product category): [product_category limit=”90″ columns=”3″ category=”foo” paginate=”true”] or inside php code: echo do_shortcode( ‘[product_category limit=”90″ columns=”3″ category=”foo” paginate=”true”]’ ); Now you will see that the sorting options dropdown appear. Note: orderby argument with an empty value … Read more
I assume that you’re only interested in the first URL that actually succeeds at discovering actual oembed data. The oembed system processes all links it finds, but not every link will have oembed going for it, obviously. The filter you’ll want to use is embed_oembed_html and it gets the HTML cached by oembed, the url, … Read more
If you only need the current theme name, you can use get_current_theme().
I ended up using this code: <?php global $post; $children = get_pages( array( ‘child_of’ => $post->ID ) ); if ( is_page() && $post->post_parent ) : ?> This is a child-page. <?php elseif ( is_page() && count( $children ) > 0 ) : ?> This is a parent-page (with one or more children) <?php else : … Read more
In other words, you should not perform a wp_enqueue_style which is not hooked to wp_enqueue_scripts. Your wp_enqueue_style should be in a function, and you should hook that function to wp_enqueue_scripts like in the following example: function wpse88755_enqueue(){ # call wp_enqueue_style here } #hook the function to wp_enqueue_scripts add_action( ‘wp_enqueue_scripts’, ‘wpse88755_enqueue’ );
Not sure what you try to accomplish, but you can get a value by key using the wp.customize object: wp.customize.value(‘show_on_front’)(); wp.customize.value(‘blogname’)(); …. sorry no jQuery here, just javascript, and yes, the extra () are intentional. Edit: Full overview of all settings: wp.customize._value; console.log(wp.customize._value); Edit II: different approach: a) lookup all available settings by using console.log(wp.customize._value); … Read more