Issue on Creating Checkbox Field On Custom Post type
Issue on Creating Checkbox Field On Custom Post type
Issue on Creating Checkbox Field On Custom Post type
Update custom field on the fly
without seeing any code you could try the following $(‘#IDofYourCountrySelectField’).on(‘change’, function() { //Code to update option values of city select field }); or $(‘#IDofYourCountrySelectField’).change(function() { //Code to update option values of city select field });
wp_get_current_user() does not return all the data for the user, you should try using get_user_meta(). Try as below $company = get_user_meta($current_user->ID,’company’); $mf_group = get_user_meta($current_user->ID,’mf_group’); and in your post loop changes this two lines as below ‘company’ => $company[0], ‘mf_group’ => $mf_group[0], Hope this helps.
There are probably print styles defined in your stylesheets. Look for @media print in your css, and write your own rules as such: @media print { img { max-width: 400px; } } etc…
So you got a lot of stuff right, and some things wrong, so I’ll go through it line by line First: wp_reset_query(); This function cleans up after a query_posts call, you should never use either of them. Sadly, a lot of tutorial writers use this instead of what they intended to use, wp_reset_postdata, as it … Read more
Can you please elaborate some more? Is this custom field possibly an ACF field? For what is this custom field tied, for a single custom post? And should this linking impact all of the posts in both post types? (Sorry, but I don’t have rights to make comments yet) Supposing all of that, what I … Read more
…Removed my prior ‘solutions’… So, the real problem here is that this function is hooked to publish_post action, at which point the post might not be saved yet, if it is a new post. Only if it is a post already saved but with some other status, we can access the ACF values using get_field(). … Read more
If I understood you correctly, you want to prevent users from selecting a radio option, which have been already selected on another post, when the user is adding a new post, right? I think you need to first check if the user is on the “add new” page in your metabox. You can do that … Read more
It turns out the latest Advanced Custom Fields update (from version 5.6.0 on) removes the core custom fields metaboxes by default. The way to restore it was to add a filter in functions.php: add_filter(‘acf/settings/remove_wp_meta_box’, ‘__return_false’);