Gutenberg theme development: how to add “headers” option under styles > colors > elements?
Gutenberg theme development: how to add “headers” option under styles > colors > elements?
Gutenberg theme development: how to add “headers” option under styles > colors > elements?
full documentation listing all of the possible keys you can provide for $args when calling register_rest_route, just as you have it with register_post_type register_rest_route(), as of writing, doesn’t have such a documentation; however, you can call $request->get_attributes() inside of your endpoint callback to get the full (registration) options (including those not explicitly specified) for that … Read more
If you put your functionality in a plugin then it can be reused across many themes. E.g. a plugin that adds font options to the customizer would be useful for lots of themes, but if it was directly built into every single theme and you needed to make a change, you would have to release … Read more
You’re already providing a schema, the parameters in args are their own schemas, but WordPress does not enforce this schema or perform sanitisation/validation by default. You can make WordPress enforce it though by setting the validation and sanitisation callbacks to the following: ‘sanitize_callback’ => ‘rest_sanitize_request_arg’, ‘validate_callback’ => ‘rest_validate_request_arg’, rest_validate_request_arg will look up the parameter in … Read more
Yeah, as you found out you don’t want to edit files directly in your theme because you will lose the changes when the theme updates. Here is some info on child themes, if you haven’t you should read it. For your particular theme, it appears the developer offers a pre-made child theme, you just need … Read more
There is nothing to escape in your code. Let’s say given function should return only plain text and no HTML entities should be allowed. For example you want to display the search query string. In such case you should use esc_html. This way, if user puts <b>ala</b> as search string, your site will print exactly … Read more
Because the naming convention is matter. You can create a new template for your different page and name it “page.php” and on the header portion give it a name: <?php /** * Template name: Different page tempate */ get_header(); ?> <div class=”yourclass”> <!– Your different template code should go here –> </div> <?php get_footer(); Once … Read more
Looking at the code for wp_update_nav_menu_item() the third parameter is an array of data about the menu item you are trying to update/create. One of the accepted items in that array is menu-item-parent-id. If you pass that key with the value of the ID of the parent menu item as part of the menu item … Read more
Apparently, in order to make it work there’s a second file (product-thumbnails.php) using the same function, so if the default function is changed in one file, the second one must be updated too.
get_search_query escapes the data for outputting to HTML. Can you try the following instead: $argscontactdirectory = array( ‘s’ => sanitize_text_field( get_search_query( false ) ), ‘post_type’ => array( ‘expertarticle’), ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, );