“After file loaded” action
I used the send_to_editor method in JavaScript. The end result ended up looking like this: window.send_to_editor = function(html) { // logic to save via AJAX goes here. }
I used the send_to_editor method in JavaScript. The end result ended up looking like this: window.send_to_editor = function(html) { // logic to save via AJAX goes here. }
I’m half asleep here so correct me if I am wrong here but it looks to me like you are saving the publish date of the post each time you save the post, $wr_event_end_date = isset($_POST[‘wr_event_end_date’]) ? $_POST[‘wr_event_end_date’] : ”; $event_end_date = new DateTime($wr_event_end_date); update_post_meta($post->ID, “event_end_date”, $event_end_date->getTimestamp()); This -> $event_end_date->getTimestamp() being the culprit. So regardless … Read more
You could do it like this: // store post meta in a variable and use that so you aren’t pulling the post meta data twice $landPricing = get_post_meta($post->ID, “Pricing_Land_Only”, true) if(!empty($landPricing)) { echo $landPricing; } else { echo “Sorry, nothing was found.”; }
If you’re using add_meta_box, the 4th paramater should be what you’re looking for. add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args ); Use http://codex.wordpress.org/Function_Reference/add_meta_box as a reference
I will assume that you(or users) will enter post ids into a posts custom field, comma separated, eg: 11,13,34,54 OR 11, 13, 34, 54. Then all you need to do is get the custom field value for the loaded post, explode the custom field value by comma(,): and, then you’ll have a nice array to … Read more
I think you’re a bit confused about how comment_form works. So let’s take a look (this is in wp-includes/comment-template.php): <?php function comment_form( $args = array(), $post_id = null ) { // snip snip $fields = array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ . __( ‘Name’ ) . ‘</label> ‘ . ( $req ? ‘<span … Read more
Change, <?php $email ?> to… <?php echo $email; ?> as you need to echo the result of what’s held within $email as the function types_render_field would be using return within the function (if you dig into its core) to return the data instead of directly printing it to screen. <?php $email = types_render_field (“email”); if … Read more
The answer was right under my nose facepalm. In the custom field suite plugin, instead of entering ProductName-2000 : ProductName-2000 you enter <a href=”http://www.site.com/ProductName-2000/”>ProductName-2000</a> : ProductName-2000 I kinda wish i could delete this question… hope it helps someone else at least. 😛
Yes, just check if you got something back from the post meta: $value = get_post_meta($post->ID, ‘_cmb__description’,true); if ( $value ) echo “<div class=”box”>$value</div>”;
I believe you forgot to add quotes around the menu parameter. <?php $post_meta_value = get_post_meta($post->ID, ‘tabmenu’, true); echo do_shortcode(‘[custommenu menu=”‘.$post_meta_value.'”]’); ?>