Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think it actually would be a good idea to save as a custom field, only one that doesn't show up in the custom field box. You can accomplish the latter by adding a "_" at the beginning of the custom field's name (i.e. "_my_custom_field" instead of "my_custom_field".</p> <p>Here's a sample function to save your meta box data. I changed the names to match the code you have above.</p> <p>:</p> <pre><code> &lt;?php function blc_save_postdata($post_id){ // Verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( !wp_verify_nonce( $_POST['blc_noncename'], plugin_basename(__FILE__) )) { return $post_id; } // Verify if this is an auto save routine. If it is our form has not been submitted, so we dont want // to do anything if ( defined('DOING_AUTOSAVE') &amp;&amp; DOING_AUTOSAVE ) return $post_id; // Check permissions to edit pages and/or posts if ( 'page' == $_POST['post_type'] || 'post' == $_POST['post_type']) { if ( !current_user_can( 'edit_page', $post_id ) || !current_user_can( 'edit_post', $post_id )) return $post_id; } // OK, we're authenticated: we need to find and save the data $blc = $_POST['backlink_url']; // save data in INVISIBLE custom field (note the "_" prefixing the custom fields' name update_post_meta($post_id, '_backlink_url', $blc); } //On post save, save plugin's data add_action('save_post', array($this, 'blc_save_postdata')); ?&gt; </code></pre> <p>And that should be it. I used this page as a reference: <a href="http://codex.wordpress.org/Function_Reference/add_meta_box" rel="nofollow">http://codex.wordpress.org/Function_Reference/add_meta_box</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload