Limit front-end submitted posts by role
Limit front-end submitted posts by role
Limit front-end submitted posts by role
I believe you should look into status transitions: https://developer.wordpress.org/reference/hooks/transition_post_status/ There are a couple of examples below the explanation on top of the page. Here’s also some example code of mine: add_action( ‘transition_post_status’, ‘nxt_create_news’, 10, 3 ); // Automatically create a news when a wiki post has been published function nxt_create_news($new_status, $old_status, $nxt_wiki_post) { if(‘publish’ === … Read more
Yes, these are probably the right calls to use for what you want. I just checked this by adding this to my functions.php: add_action(‘publish_to_draft’, ‘doStuff’); function doStuff() { update_option(‘foo’, ‘bar1’); } Then using the quick edit in the posts list to change a published post to draft, and this hook definitely ran at that point … Read more
The short answer is that the value for category should be an array of IDs. The longer answer is that it is rarely appropriate to use query_posts at all.
Updating post status via rest api
How to fix wordpress blog post error? Can anyone help to fix this issue?
After realizing that I was trying to use the same shortcode for two different types of lists, it was easier to just separate them in two different shortcodes. To list all posts and break them up by type: /** * Shortcode for listing all tools matching tags * Usage: [useful-tools-all desc=”true” li=”true” tags=”health, teens”] * … Read more
Classic Button in Classic editor
You can try this CSS In Customize -> Additional CSS: .post-single-img { width: 500px; margin: 0 auto; } margin: 0 auto is used to center the image
I solved this problem by just deleting the previously uploaded images from the media library, and re-adding them. So simple. Can’t believe I didn’t think of it earlier.