Hot answers tagged

3 votes

Setting default font family with theme.json

I had the same problem and I find out how to solve it: For each "fontFamily" inside "fontFamilies" array, you get a custom variable. From your example You can use both variables on ...
user avatar
  • 31
2 votes

Gutenberg custom block using only register_block_type() and HTML

No, blocks are built with more than HTML - they need JS and PHP. However, you could add an HTML block wherever you need it, then click the More Options dots in the block's toolbar, click Add to ...
user avatar
  • 8,643
2 votes
Accepted

JSON REST API Wordpress only showing first 10 categories

This is normal behaviour, you've not accounted for pagination. The REST API returns 10 results per page by default, and can be configured to return up to but no more than 100 per page. You may be ...
user avatar
  • 51.7k
1 vote

JSON - Create rest api endpoint for Advanced Custom Fields

TL;DR - ACF now has support for the WP REST API Hey all, Iain the Product Manager for Advanced Custom Fields here 👋 As part of the ACF 5.11 release we added native support for ACF fields in the ...
user avatar
1 vote

Is it safe to upload JSON files to upload folder?

JSON files are really data files: they are not a security threat per se, it's simply that WordPress doesn't include them in its whitelist. It really depends on who can upload the data and what you do ...
user avatar
  • 286
1 vote
Accepted

Sql formatting for post data within function

It isn't showing wp_posts.post_content LIKE '%test%' because the wildcards (%) in the prepared statement are converted to placeholder escape strings (like the {...
user avatar
  • 31.4k
1 vote

json encode not work in wordpress

wp_send_json() already converts the value to JSON, so you don't need to do it again. You can remove wp_json_encode().
user avatar
1 vote
Accepted

How to connect android app with Wordpress website?

Out of the box there is no mechanism for a user to login via the REST API to begin a session without pre-configured access. WordPress Core provides 2 authentication methods for the REST API: cookies +...
user avatar
  • 51.7k
1 vote

WordPress Shortcode / Only works in classic editor, gutenberg error / invalid json response

A shortcode should only ever return content, never echo it. The bits between the ?> and <?php tags -- the <script> tags and the rest -- are effectively being echoed to the browser, which ...
user avatar
  • 10.2k
1 vote
Accepted

How to add/edit advanced custom fields on custom post type's WordPress REST API?

I think the only thing missing here is an update_callback in the call to register_rest_field. register_rest_field( 'note', 'noteLink', array( 'get_callback' => function(){ return ...
user avatar
  • 386
1 vote

woocommerce registration form with klaviyo(don't work with current user)

Hey guys there are just a few changes in the above code. Check this out it works for me. Note: Please change the LIST_ID to your klaviyo's list id, and get one private key from your klaviyo account ...
user avatar
1 vote

Setting default font family with theme.json

At this time, typography.fontFamilies is only available in the Gutenberg plugin. The plugin must be installed for this setting to take effect. See the comparison toggle at https://developer.wordpress....
user avatar
  • 488

Only top scored, non community-wiki answers of a minimum length are eligible