Tag Info

Hot answers tagged

1

This will be made in the side of the template. First get all the sizes into an array: $allSizes = array( 'XS' => 'Extra Small', 'S' => 'Small', 'M' => 'Medium', 'L' => 'Large', 'XL' => 'Extra Large', 'XXL' => 'Extra Extra Large', ); echo '<ul>'; $outStock = get_post_meta($post->ID, 'Sizes_available', ...


1

Actually your question is off-topic here, because it's javascripts specific and not specific to WordPress. But I'm answering it and making it more WordPress-centric so that others get help too. The following function will enqueue a custom.js file from your theme folder's /js subfolder to only admin panel (put it in functions.php of your theme): function ...


1

You get that error, because the $_GET and $_POST are not filled on every admin page with that data. Also, your code should never rely on globals, they can be changed by any other code, so they are not reliable. So don't use global $post;, $_POST or $_GET when you can get the information from better sources like here. Use the action add_meta_boxes to … well ...



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