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

Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”

It’s working, I traced it by digging through admin-ajax.php to see what was responding with 401/400. My fix was basically making the action parameter the last thing appended to the formData formData.append(“enquiry”, form); formData.append(“action”, “enquiry”); I don’t normally use formData to post things, .serialize() has always been enough for me over the years. As I … Read more

How to rename woocommerce-billing-fields

Copy \woocommerce\templates\checkout\form-billing.php and \woocommerce\templates\checkout\form-checkout.php to \yourtheme\woocommerce\checkout\form-billing.php find this code <h3><?php _e( ‘Billing & Shipping’, ‘woocommerce’ ); ?></h3> in form-billing.php and <h3 id=”order_review_heading”><?php esc_html_e( ‘Your order’, ‘woocommerce’ ); ?></h3> and make the necessary changes . Hope you are not doing this for anything regarding to I18n.

wp_insert_post() with HTML tags using PHP

Can you try to wrap you wp_insert_post call like bellow: kses_remove_filters(); //This Turns off kses $post_id = wp_insert_post( $my_post, true ); kses_init_filters(); //This Turns on kses again So I tried your code with my method and it perfectly worked. Here is what I did. $title = “My news”; $content=”<p> <img src=”https://wordpress.stackexchange.com/questions/368433/img-link”> </p> <p> Hi, this … Read more

How to make jquery count down timer function manually editable

You can achieve this using wp_footer action. Add bellow code to functions.php file. It will load the script at the footer of page. add_action(‘wp_footer’, ‘load_count_down’); function load_count_down(){ if ($year = get_option(‘of_year’) && $month = get_option(‘of_month’) && $day = get_option(‘of_day’) ) { $date = $year.”https://wordpress.stackexchange.com/”.$month.”https://wordpress.stackexchange.com/”.$day; $script = <<<EOF <script type=”text/javascript”> var siteCountDown = function() { if … Read more

Add additional functions file instead of functions.php

You can include multiple files in your functions.php. I do this to keep things organized. All my functions are in a functions subfolder, so my functions.php file just looks like this: require get_template_directory() . ‘/functions/function-1.php’; require get_template_directory() . ‘/functions/function-2.php’; require get_template_directory() . ‘/functions/function-3.php’; If you have functions you only want called on certain pages, for … Read more

Design with Elementor and code the rest?

It is not possible to use a drag and drop page builder like Elementor to edit the design of a custom-coded theme. If you really want to use Elementor, you could use Elementor Pro’s theme builder to recreate the original theme manually.