plugin-development

plugins – Sanitize $_GET variable when comparing – WordPress Website Design Article

I know when I want to save data in database, I must sanitize data but what about following case which is a simple comparison. Should I sanitize? if ( ! isset( $_GET[‘page’] ) ) { return; } if ( ‘google’ === $_GET[‘page’] ) { wp_redirect( ‘https://google.com’ ); exit; } if ( ‘facebook’ === $_GET[‘page’] ) { wp_redirect( ‘https://facebook.com’ ); exit; } This is only a snippet of a WordPress Website Design Article written by user3631047 Read Full Article

Read More

plugin development – How do I get a reference to the HTML memory buffer while the page is being constructed? – WordPress Website Design Article

I want to view & update the buffer with html “<head>” data section in it, after the head has been generated. Problem statement: I have created some shortcodes in a plug-in which, if present on a page, also require some CSS formatting to be included. The CSS should be included in the section as a link to a CSS file. In the shortcode processing, I wp_enqueue_style()‘ed the CSS, but since the shortcode processing occurs during the body processing, (after the…

Read More