My metabox class

it says right in the instructions that you just include the class //include the main class file require_once(“meta-box-class/my-meta-box-class.php”); you’d put that in whatever file you are using for the code blocks you posted… not in the function you’ve written. looks like there is a pretty good section called “Usage” at the link you provided. you … Read more

meta_value_num sort glitch

You want natural order sorting, Example; $val = array(5.1, 5.11, 5.12, 5.2, 5.21); natsort($val); foreach ($val as $key => $val) { echo $val.”<br>”; } Produces: 5.1 5.2 5.11 5.12 5.21 Where as; $val = array(5.1, 5.11, 5.12, 5.2, 5.21); asort($val); foreach ($val as $key => $val) { echo $val.”<br>”; } Produces: 5.1 5.11 5.12 5.2 … Read more

Frontend posting – everything saves other than checkboxes?

Did you check the database for the data? My guess is that the problem is here: echo ‘<input type=”checkbox” name=”cbn[]” id=”‘.$option[‘value’].'”‘,$checkboxes && in_array($option[‘value’], $checkboxes) ? ‘ checked=”checked”‘ : ”,’ /> ‘; should be: echo ‘<input type=”checkbox” name=”cbn[]” id=”‘.$option[‘value’].'”‘.$checkboxes && in_array($option[‘value’], $checkboxes) ? ‘ checked=”checked”‘ : ”.’ /> ‘; Edit: You’re confusing poor PHP. Try enclosing … Read more

little help with a mySQL query to wp database

Following the recomendations of @toscho i had a look at get_results and the following edits to the function ended up doing the trick. if ( ! function_exists( ‘get_meta_values’ ) ) { function get_meta_values( $key = ”, $type=”post”, $status=”publish” ) { global $wpdb; if( empty( $key ) ) return; $r = $wpdb->get_results($wpdb->prepare( ” SELECT pm.meta_value, pm.post_id … Read more

all tincymce’s switch when updating page after changing from html to text in custom metabox

This is, as you guessed, default behavior. It’s stored in the wp_usermeta table for each user in the wp_user-settings meta_key and does not differentiate between different editor instances. On a side note, the tinymce version of wp_edior() does not cooperate very well with being inside a meta box. Especially if the metabox is moved, or … Read more