template_redirect and title
template_redirect and title
template_redirect and title
Replace the function into your functions.php file – function update_dynamic_select() { update_post_meta($_POST[‘aid’], $_POST[‘field’], $_POST[‘value’]); echo $_POST[‘value’]; die(); } Replace options in your HTML part – <?php $val = get_post_meta( 104, ‘_image_matmenys’, true ); $s1 = ($val == “10×10″) ? ‘selected=”selected”‘ : ”; $s2 = ($val == “20×20″) ? ‘selected=”selected”‘ : ”; $s3 = ($val == … Read more
Comments closed only for contributors
calling a function from a class in your template
A correct hook for saving meta boxes data
Saving post doesn’t just happens. Either you are submitting a form or ajax request, which spins up new copy of WP core, which does the saving. Typically that process isn’t meant to produce output and isn’t handling it accordingly. Depending on what you want to accomplish you will have to either use pure JavaScript for … Read more
How to `remove_action` from plugin
Have your function return your HTML rather than echo it. Perform the logic in the function to see if the image/logo are present and only return the HTML if that’s the case, otherwise returning null/false. function my_header_function( $output = false ) { if ( /*image and logo have been uploaded */ ) { $output = … Read more
The short answer is that there isn’t one. WordPress templating consists mostly of raw PHP and Template Tags API. The API is more focused on outputting specific content, than producing specific HTML. As result the technique is pretty much unknown in WordPress development. It doesn’t mean that you can’t use one, but it’s just not … Read more
Errm, you can’t. And more importantly, why would you want to? The whole point of hooks is to open up an API to other developers! You can use a singleton/static flags and/or private methods (called from a hooked public method) if you want to lock down how your plugin can be manipulated. static function myfunction_for_themes() … Read more