Decide Metabox Configurations for All Users

Metabox configuration is stored in the user meta, there are several of them so best way to find all out is to look at the ajax handlers code in \wp-admin\include\ajax-actions.php, therefor you should be able to set it up at user creation time to whatever value you want.

Troubles with saving metabox

There are different ways of saving the metaboxes. for e.g. you can create 2 files 1) test-spec.php 2) test-meta.php In test-spec.php file <?php //DEFINE VARIABLE TO STORE THE METABOX $content_test_meta = new WPAlchemy_MetaBox(array ( ‘id’ => ‘_content_test_meta’, //UNIQUE ID FOR THIS META BOX ‘types’ => array(‘post’), //LIMIT TO ONLY SHOW ON Default POST TYPE ‘template’ … Read more

Visual/Text tabs in wp editor Not Showing

Without seeing your code I can’t say whats wrong but here is a working (tested) example of a metabox with an editor inside that has the visual/text tabs. add_action( ‘add_meta_boxes’, function() { add_meta_box(‘html_myid_61_section’, ‘Meta Box Title’, ‘my_custom_meta_function’); }); function my_custom_meta_function( $post ) { $text= get_post_meta($post, ‘my_custom_meta’ , true ); wp_editor( htmlspecialchars_decode($text), ‘mettaabox_ID’, $settings = array(‘textarea_name’=>’inputName’) … Read more

Push metadata in array

You need to loop through your posts, and retrieve the metadata for each post. Add them to your array, and encode them to JSON. $posts = $query->get_posts(); foreach( $posts as &$thispost ) { // reference the current item $thispost->meta = get_post_meta( $thispost->ID ); } Now you got a WP_Post-Object, with all the post meta available … Read more

Metabox context for page post type

There is user settings (user metadata) which override the initial meta box order. So it is up to user which meta box he want to display first. User can drag and drop metaboxes and arrange them in any order which he want regardless the order you’ve defined. You can go to user meta table and … Read more

Custom metabox for custom page template

<? // Check: // 1. If you are editing post, CPT, or page // 2. If post type IS NOT SET if( ‘post.php’ == basename($_SERVER[‘REQUEST_URI’], ‘?’ . $_SERVER[‘QUERY_STRING’]) && !isset($_GET[‘post_type’]) ) { // get post ID $postid = $_GET[‘post’]; // check the template file name if (‘my_template.php’ == get_page_template_slug($postid) ) { // add your metabox … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)