This file contains hidden or 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 | |
/** | |
* Register plugin icons. | |
* | |
* WordPress 4.9 introduced icons in the list table on the Manage Plugins | |
* screen. The icons are pulled from the W.org update API. If an icon isn't | |
* available, a generic plugin Dashicon is shown instead. | |
* | |
* @param array $value Plugin update data. | |
* @return array |
This file contains hidden or 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 | |
/** | |
* Third Party Styles | |
* More info: https://github.com/grappler/wp-standard-handles | |
*/ | |
// Incorrect | |
wp_enqueue_style( 'prefix-font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '4.2.0', 'all' ); | |
// Corrrect |
This file contains hidden or 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 | |
// Functions | |
function prefix_setup() | |
// Classes | |
class Prefix_Class {} | |
// Global Variables | |
global $prefix_passengers; |
This file contains hidden or 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 | |
// Use anytime HTML element encloses a section of data: | |
echo esc_html( $no_html ); | |
// Use on all URLs, including those in the 'src' and 'href' attributes of an HTML element: | |
<img src="<?php echo esc_url( $escaped_url ); ?>" /> | |
// Use for inline Javascript: | |
<a href="#" onclick="<?php echo esc_js( $escaped_js ); ?>"><?php esc_html__( 'Click Here', 'text-domain' ); ?></a> |
This file contains hidden or 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 | |
// These are incorrect: | |
__( 'Some String', 'text-domain' ); _e( 'Some string', 'text-domain' ); | |
// Instead, use: | |
esc_html__( 'Some String', 'text-domain' ); esc_html_e( 'Some String', 'text-domain' ); | |
/** | |
* For strings with necessary HTML, use the following: | |
* Note that I'm only including the actual allowed HTML for this specific string. |
This file contains hidden or 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
/** | |
* Customize the default success message presented on the contact template. | |
*/ | |
function prefix_custom_success_msg() { | |
esc_html_e('Wohoo! We have received your mail!', 'mark'); | |
} | |
add_filter( 'bean_contactform_success_msg', 'prefix_custom_success_msg' ); | |
This file contains hidden or 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 | |
/** | |
* Escape all translations with | |
*/ | |
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );. | |
/** | |
* When there is no HTML use: | |
*/ |
This file contains hidden or 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
'id_submit' => 'submit', | |
'class_submit' => 'submit', | |
'name_submit' => 'submit', | |
'submit_field' => '<p class="form-submit">%1$s %2$s</a>', | |
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', |