4
Why WordPress creates two transients: Because the first transient with timeout in the name, is used for storing the expiration you set for your transient (but the stored value is a UNIX timestamp, not simply the value you passed like 3600) so that WordPress knows when to delete your transient. As for the second one, it stores the actual transient value that ...
2
Naren,
The actual set-up for the classic/TinyMCE editor is relatively straightforward, I have updated your wordpress_register_fields() function with the necessary lines. For wp_editor() to work you need to get the content if there's any saved, id the field and then provide settings arguments. (https://developer.wordpress.org/reference/functions/wp_editor/)
...
1
What's the problem of this code?
You incorrectly called get_page_by_path() whereby if you want to specify the post type (the third parameter), then you need to specify the second parameter as well which is the return type and defaults to OBJECT. So:
// Wrong: Missing the return type (second parameter).
// Or I mean, the third parameter "becomes" ...
1
You added the library via Composer, but as it sounds you have not loaded Composer's autoloader in your PHP code. This is necessary so PHP knows where to find classes (without the need for manual require() statements for each file).
If you check the documentation, you'll see this code
require __DIR__ . '/vendor/autoload.php';
This is what you should do in ...
1
as @TomJNowell told me in the comment, it was because of heavy font files. so I decided to use just woff2 format and removed other formats.
1
thanks to: https://javascriptforwp.com/forums/topic/how-to-get-a-color-class-name/ , Note: wp.editor.getColorObjectByColorValue is deprecated now using wp.blockEditor.getColorObjectByColorValue
const { select } = wp.data;
const { getColorObjectByColorValue} = wp.blockEditor;
function onChangeColor ( color ) {
colorName = '';
if( ...
1
This answer has what you want https://wordpress.stackexchange.com/a/314152/49962
WP already does this out of the box thanks to the include_children parameter of tax_query which is true by default.
So you do not need to tell it the sub-terms, just do something like this:
/wp/v2/posts?categories=1
Where categories=1 is the parent category ID
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
plugin-development × 5906plugins × 1716
php × 639
theme-development × 368
custom-post-types × 343
hooks × 262
functions × 259
customization × 246
woocommerce-offtopic × 223
ajax × 220
filters × 170
javascript × 170
shortcode × 161
actions × 155
jquery × 153
database × 147
wp-admin × 145
options × 141
widgets × 129
settings-api × 110
wp-query × 105
block-editor × 98
custom-field × 97
wp-enqueue-script × 97
posts × 95