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
// Doc File example | |
/** | |
* Recipe class file | |
* | |
* PHP Version 8.1 | |
* | |
* @category Recipe | |
* @package Recipe | |
* @author pedro henrique romio dos santos <pedrohenriqueromio@gmail.com> |
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 | |
$post_type = 'my_cpt'; | |
// Register the columns. | |
add_filter( "manage_{$post_type}_posts_columns", function ( $defaults ) { | |
$defaults['custom-one'] = 'Custom One'; | |
$defaults['custom-two'] = 'Custom Two'; |
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
.env usando php 7.4 | |
cd {devilbox dir}/cfg/php-ini-7.4 | |
criar arquivo xdebug.ini | |
""" | |
; Defaults | |
zend_extension=xdebug.so | |
xdebug.mode=profile |
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) { | |