How to implement Sentry on WordPress? [closed]

For php I used this guide: https://cloudpresshosting.co.uk/blog/reporting-wordpress-errors-to-sentry For JS, I found out I can take the code of the bundle and the initialization and put in the header, using “add scripts to header and footer” plugin. https://wordpress.org/plugins/header-and-footer-scripts It took me time to notice I can’t put the initialization within the bundle import. Got something like … Read more

Gutenberg Blocks – Change EDIT part of the block using editor.BlockEdit filters. How to change the markup?

Unfortunately there is now way to alter the markup of an existing block apart from wrapping it in additional markup: It receives the original block BlockEdit component and returns a new wrapped component. Source: https://developer.wordpress.org/block-editor/developers/filters/block-filters/#editor-blockedit To achieve what you want in the editor currently the only way would be to create your own version of … Read more

add_meta_box (Will display only in specific page admin WordPress)

/* Add meta boxs for particular pages */ function meta_set_particular_page() { $post_id = $_GET[‘post’] ? $_GET[‘post’] : $_POST[‘post_ID’]; $current_page_title = get_the_title($post_id); if ($current_page_title == ‘home’) { add_meta_box(‘Home_page’, ‘Home Name:’, ‘only_home’, ‘page’, ‘side’, ‘core’); } if($current_page_title == ‘about’){ add_meta_box(‘About_page’, ‘About Name:’, ‘only_about’, ‘page’, ‘side’, ‘core’); } } add_action(‘add_meta_boxes’, ‘meta_set_particular_page’); /* Add custom meta box for home … Read more

Should you escape hardcoded URLs?

No, you don’t need to escape hardcoded values. As I understand it, if the URL doesn’t have an input via admin, it should be okay. Not necessarily. There’s many more potential sources of potentially malicious (or just accidentally broken) output that need to be accounted for, such as: Translations. Query strings ($_GET) Cookies. WordPress filters. … Read more