Tag Info

Hot answers tagged

3

You could use ajax and the admin_footer-post-new.php hook. The sql would vary depending on whether you want the highest or most recently published order number. The following returns the highest published order number + 1: function wpse155926_set_menu_order() { $ret = array(); if ( check_ajax_referer( 'wpse155926_set_menu_order_post', 'nonce', ...


2

You could hook into the publish_page transitional status action and use a simple SQL query (via $wpdb) to determine the highest current value of menu_order in the {prefix}_posts table and set the menu_order of the new page accordingly. Example code: add_action( 'publish_page', 'wpse155926_set_to_last_page', 10, 2 ); function wpse155926_set_to_last_page( ...


2

WordPress has built-in support for posting via email. Go to Settings > Writing in your admin and enter your credentials under "Post via e-mail". Note it won't handle Gmail labels (it only works via POP3).


1

Playing with XML-RPC and underscored custom fields: Let's say we want to set the featured image to a given post with $remote_post_id. We want it to be the attachment with ID equal to 300, so we want _thumbnail_id to be 300. Here are three methods how one could achieve that: Method #1 - Using post_thumbnail It's possible to update/add the featured image ...


1

_Underscored meta data is defined to be data which is internal to the software and not directly changed by a user. This is probably why you can't change it via XMLRPC. If you need this kind of functionality you can write a small plugin that extends the set of data you can change with XMLRPC. But Since you question is specifically about featured images you ...


1

It think that your problem is the you are passing the post ID as url parameter to facebook API: $url = get_the_ID(); Also, as get_posts return an array of post objects, you could use this code: $posts = get_posts(array('numberposts' => -1) ); foreach($posts as $post) { $url = get_permalink( $post->ID ); $fbcount = json_decode( ...



Only top voted, non community-wiki answers of a minimum length are eligible