Hot answers tagged

4

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 ...


2

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 ...


1

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.


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

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. ...


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 ...


1

It's nothing to do with the class itself - you are using the reserved input name post, which is conflicting with WordPress core: <input type="checkbox" name="post[]" value="%s" /> Change it something unique to your theme/plugin e.g. name="my_plugin_ids[]"


1

The meta_value field is longtext, which a quick google reports is 4,294,967,295 characters - I doubt you're exceeding that. Chances are it's an issue with PHP, specifically post_max_size - if this is less than the "huge amount of data" you are referring to, PHP will simply truncate $_POST and you end up with nothing.



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