Rewrite Rule for Post Meta

Okay! So I got this working by just changing the rewrite_rule to include the event… function aca_award_cat_rewrite_rule() { add_rewrite_rule( ‘^awards/([^/]*)/award-category/([^/]*)/?’, ‘index.php?competition=$matches[1]&award_category=$matches[2]’, ‘top’ ); }

Adding language based URL structure

If you’re talking about pages, you can create a parent page with the country code as it’s URL and set all the other pages as children of it. You could even make that page the homepage for that language. If you mean posts, you could create a custom taxonomy and follow these instructions to add … Read more

Get post and its children with WP_Query

The question that is similar to your question, i took sample code from there. you can replace ‘post_parent with this. global $post; $args = [ ‘wpse_include_parent’ => true, ‘post_parent’ => wp_get_post_parent_id( $post->ID ), ‘post_type’ => ‘post’ // Add additional arguments ]; $q = new WP_Query( $args ); This code will get the parents post id … Read more

Cant register rest routs from class instance

There’s several things wrong here, none really related to OOP. Firstly, you seem to be attempting to register the REST routes on plugin activation. This is incorrect. Routes need to be registered for every request, so BusinessCustomersApiController->register_routes() needs to run on every request. You do this by hooking that function to the rest_api_init. The problem … Read more

Loading the native WordPress image uploader in custom widget

All you have to do is to load a couple of scripts, four, to be precise. Register your widget class first Load the media library Pass some variables to translate things properly (please see translation standards of WordPress for more info about this.) Add your own script on top to trigger the modal window and … Read more

Moving Existing images from custom directory to WP’s upload directory

Thanks for the response @jxxe. So I ended up figuring out how to do what I needed to do. For anyone else who might be needing the same thing, here’s what I did. Downloaded /assets/ directory via SFTP Commented out define(‘UPLOADS’, ‘assets’); in wp-config.php Uploaded contents of assets to /wp-content/uploads/ via SFTP Surprisingly, I didn’t … Read more