New answers tagged

0

There is an other way, by the way we can put the editor to any position: Remove editor from support param when you register post_type add a fake metabox add_meta_box( 'does-not-matter', __( 'Description'), function($post){ wp_editor($post->post_content,'post_content',array('name'=>'post_content')); }, 'post_type_type', 'advanced', 'high' ); ...


0

NOTE the difference between add_meta_boxes and register_meta_box_cb. When you register the meta boxes using add_meta_boxes, here is how WordPress calls do_action() /** * Fires after all built-in meta boxes have been added. * * @since 3.0.0 * * @param string $post_type Post type. * @param WP_Post $post Post object. */ do_action( ...


2

Post type names cannot contain capital letters. So behind the scenes, your CPT is probably called projectscpt rather than ProjectsCPT - hence it not matching the value in your array.


3

Input from the user or other functions etc you validate and sanitize. For sanitizing sql strings before execution (important one!) look at this page http://codex.wordpress.org/Data_Validation under Database. When you want to sanitize input from a not trusted source then sanitize look under text input or use ...


5

Yes it does. Escaping depends on context and in worst case like using esc_html when writing directly to the DB are just a security hole. Even if there is no security issue, there is theoretical one. The user asked you to store A, and you are storing B. In a simple cases B is exactly how A should be displayed in the HTML, but life is rarely simple and while ...


1

You need to query the db using wp_query to get all the posts from the CPT, save the metabox contents to an array and then print the array. Not tested but should work (i hope): <?php $select_array = array(); $args = array ( 'post_type' => 'your_cpt', ); $query1 = new WP_Query( $args ); while ( $query1->have_posts() ) { $query1->the_post(); ...


-1

Changed the priority from add_meta_box() to high instead of default and it worked...


0

Since you are using single values anyway, how about trying just: $meta_SDate = get_post_meta($post->ID,'event_start_date',true); $meta_EDate = get_post_meta($post->ID,'event_end_date',true); Also note the following lines will need a space to separate the posted values so strtotime can work properly: $updStartD = ...


0

I found a simpler solution Add this to your functions.php // Update CSS within in Admin function admin_style() { wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css'); } add_action('admin_enqueue_scripts', 'admin_style'); and point it to a CSS file in your theme folder with this @media (min-width: 850px) { .post-php ...


1

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 find key with name meta-box-order_{post_type} e.g. ...


0

I have managed to remove this. If anyone else is wondering how simply go to. /themes/theme-name/includes/helpers open up SEO.php. And do Ctrl+F for generator or Wow-Themes.


0

I would suggest the filter_var() function in php http://php.net/manual/en/function.filter-var.php. It has some predefined filters thats you can use. So to sanitize for a number: $sanitizedCheckbox = filter_var($yourVar, FILTER_SANITIZE_NUMBER_INT); For a string you would just change "_NUM_INT" to "_STRING".


1

You didn't add the save meta action for the facebook meta box. <?php /* Fire our meta box setup function on the post editor screen. */ add_action( 'load-post.php', 'sw_post_meta_boxes_setup' ); add_action( 'load-post-new.php', 'sw_post_meta_boxes_setup' ); /* Meta box setup function. */ function sw_post_meta_boxes_setup() { /* Add meta boxes on the ...



Top 50 recent answers are included