Hot answers tagged

1

Change form.php <form action="<?= $_SERVER["REQUEST_URI"]; ?>" method="post"> <input type="hidden" name="form_submit_nonce" value="<?php echo wp_create_nonce('form-submit-nonce'); ?>"/> <label for="id">ID</label> <input id="id"...


1

If you just want to get the selected color name, then you can use the getColorObjectByColorValue() function in the @wordpress/block-editor package, which is wp.blockEditor.getColorObjectByColorValue in the browser. The function accepts two parameters: a color list (each is an object with color and name as the properties), and the color (a HEX code, e.g. #...


1

Sometimes you want to delete not the html code but shortcode. Then use something like that: add_action( 'pre_amp_render_post', 'amp_vid_rmv' ); function amp_vid_rmv() { add_filter( 'the_content', 'amp_vid_div_rmv' ); } function amp_vid_div_rmv($content) { $content = preg_replace('#\[shortcode_name_here\]<br \/>#', '$1', $content); ?> <...


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