New answers tagged

1 vote

How to add Internationalization in WordPress using Javascript/React?

I see that you do not use register_block_type in PHP, which is now recommended way to register block. I am assuming you register block in the front-end ( I am not familiar with create-block ), and ...
user avatar
  • 416
0 votes

How to redirect non logged in mobile users to page on same site?

Going by the js you provided you can just do this if ((screen.width <= 800) && (document.location="https://example.com/")) { location.href = "https:example.com/m-home-...
user avatar
0 votes

getEntityRecord without knowing the post type

As of today, you can use the following to get the current post type : import { useSelect } from '@wordpress/data'; const postType = useSelect( (select) => select('core/editor')....
user avatar
0 votes

create timestamp links to jump to specific times on rumble videos

Although I appreciate user141080's attempt to give feedback on your question, he gave kind of a squirmy answer that did not address your concern. I believe the question was how to create a timestamp ...
user avatar
0 votes
Accepted

How do I add <div> tags to entire comments, not just their text

Currently your comment markup looks similar to the following: <li class="comment byuser comment-author-rcotwunite odd alt thread-odd thread-alt depth-1" id="comment-7902"> &...
user avatar
  • 5,340
0 votes
Accepted

How to use wp_send_json() and output the value with ajax?

You can follow below steps: HTMl Code: <button id="clickMe" data-nonce="<?php echo esc_attr( wp_create_nonce( 'my-nonce' ) ); ?>">Click Me</button> PHP Code: ...
user avatar
1 vote
Accepted

Trigger wp-embed via JavaScript to refresh iframe preview?

Unfortunately WP Embed isn't responsible for converting links into iframes. The conversion of links and [embed] shortcodes into iframes is implemented by OEmbed and that happens via OEmbed APIs on ...
user avatar
  • 52.4k
0 votes

Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?

Never mind! I managed to come up with a solution. function insert_location(){ ob_start(); ?> <select name="location" id="location" class="postform"> ...
user avatar
0 votes

Show only images and videos in a wp.media window

I am pretty much late to this answer and i was stuck but this how I was able to get it right after spending hours. Hopefully this will help anyone who is reading. Basically just modify the media ...
user avatar
1 vote
Accepted

Translate javascript with WordPress built-in localization API for static strings

wp_localize_script() defines a variable in the global JS scope - in the case of your code, the object is placed in a globally-scoped variable with the identifier MediaFolders. In your load event ...
user avatar
  • 5,340

Top 50 recent answers are included