New answers tagged javascript
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 ...
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-...
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')....
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 ...
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">
&...
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: ...
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 ...
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">
...
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 ...
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 ...
Top 50 recent answers are included
Related Tags
javascript × 2537jquery × 530
php × 491
ajax × 296
plugins × 280
wp-enqueue-script × 219
plugin-development × 191
block-editor × 187
css × 174
functions × 149
html × 119
theme-development × 98
customization × 71
woocommerce-offtopic × 68
theme-customizer × 68
rest-api × 57
themes × 54
wp-admin × 54
shortcode × 52
posts × 51
tinymce × 51
scripts × 46
hooks × 43
uploads × 43
custom-post-types × 42