This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example # 2 from | |
// https://codex.wordpress.org/Creating_Options_Pages | |
class MySettingsPage | |
{ | |
/** | |
* Holds the values to be used in the fields callbacks | |
*/ | |
private $options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create a new custom yoast seo sitemap | |
*/ | |
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' ); | |
add_action( 'init', 'init_wpseo_do_sitemap_actions' ); | |
// Add custom index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get Hexadecimal color code | |
\#([a-fA-F]|[0-9]){3, 6} | |
Validate email address | |
/[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}/igm | |
IPv4 address | |
/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/ | |
IPv6 address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extend Recent Posts Widget | |
* | |
* Adds different formatting to the default WordPress Recent Posts Widget | |
*/ | |
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { | |
function widget($args, $instance) { | |