Type: php
Untitled Snippet (copy)
Untitled Snippet
Current Year
function wpcode_current_year() { return date(‘Y’); } add_shortcode(‘current_year’, ‘wpcode_current_year’);Continue reading
hkosnip
// index.php?name=david echo $_GET[‘name’]; // index.php?name=david&surname=adams echo $_GET[‘surname’];Continue reading
Security headers
// Functie om beveiligingsheaders toe te voegen aan de WordPress-site function add_security_headers() { // X-Frame-Options: Voorkomt clickjacking door te voorkomen dat de site in een iframe wordt geladen header(‘X-Frame-Options: DENY’); // X-Content-Type-Options: Voorkomt MIME-type sniffing header(‘X-Content-Type-Options: nosniff’); // Referrer-Policy: Beperkt…Continue reading
Duplicate Post/Page Link (copy) (copy)
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
Duplicate Post/Page Link (copy)
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
Untitled Snippet
/** * WPCode: Highwire meta – Revista Chilena de Anestesiología (robusto + debug) * – Imprime meta tags en de posts. * – No requiere ACF salvo para el repeater de autores (contrib). * – Incluye comentario HTML de debug…Continue reading
Add Media File Size Column
// 1. Add a column for file size in the Media Library table function custom_media_column_file_size( $columns ) { $columns[‘file_size’] = __( ‘File Size’, ‘custom-media-columns’ ); return $columns; } add_filter( ‘manage_media_columns’, ‘custom_media_column_file_size’ ); // 2. Display the file size for each…Continue reading