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 | |
function paragraph_cb( $attributes, $out ) { | |
$out = $this -> bottom_whitespaceify( $out ); | |
return $out; | |
} |
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 | |
function quote_cb( $attributes, $out ) { | |
$out = wpautop( $out ); | |
$i = new Icon( 'quote-left', FALSE, array( 'block w-6' ) ); | |
$mark = $i -> get(); | |
$out = $this -> css_classify( $out, 'blockquote', array( 'flex', 'flex-col', 'space-y-5' ) ); |
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 | |
/** | |
* Determine if a widget should be hidden from QA. | |
* | |
* @param string $widget_id The ID for this widget instance. | |
* @return boolean Returns TRUE if the widget should be hidden from QA, else FALSE. | |
*/ | |
static function is_widget_hidden_from_qa( $widget_id ) { |
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 | |
function debug( $bug ) { | |
ob_start(); | |
var_dump( $bug ); | |
$out = ob_get_clean(); | |
error_log( $out ); | |
} |
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 | |
function call() { | |
$response = wp_remote_request( $this -> url, $this -> args ); | |
$code = wp_remote_retrieve_response_code( $response ); | |
$first_digit = $code[0]; | |
$good_responses = array( 2, 3 ); | |
if( ! in_array( $first_digit, $good_responses ) { | |
$body = wp_remote_retrieve_body( $response ); |
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 | |
// Purge all the transients associated with our plugin. | |
function purge() { | |
global $wpdb; | |
$prefix = esc_sql( $this -> get_transient_prefix() ); | |
$options = $wpdb -> 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 | |
function agoify( $from_date, $to_date = FALSE ) { | |
if( ! $to_date ) { | |
$to_date = current_time( 'timestamp', get_option( 'gmt_offset' ) ); | |
} | |
$human_time = human_time_diff( $from_date, $to_date ); | |
$out = sprintf( esc_html__( '%s ago', 'boilerplate' ), $human_time ); |
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 | |
function set_is_update() { | |
$fv = $this -> get_file_version(); | |
$dbv = $this -> get_database_version(); | |
// returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower. | |
$compare = version_compare( $fv, $dbv ); | |
if( $compare === 1 ) { |
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 | |
class BodyClass extends Base { | |
public function __construct() { | |
$this -> conditionals = get_boilerplate() -> conditionals; | |
add_filter( 'body_class', array( $this, 'has_post_thumbnail' ) ); | |
add_filter( 'body_class', array( $this, 'is_singular' ) ); | |
add_filter( 'body_class', array( $this, 'admin_bar' ) ); |
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 | |
$out = array( | |
'' => esc_html__( 'Please choose a state.', 'boilerplate' ), | |
'AL' => esc_html__( 'Alabama', 'boilerplate' ), | |
'AK' => esc_html__( 'Alaska', 'boilerplate' ), | |
'AS' => esc_html__( 'American Samoa', 'boilerplate' ), | |
'AZ' => esc_html__( 'Arizona', 'boilerplate' ), | |
'AR' => esc_html__( 'Arkansas', 'boilerplate' ), | |
[...] |
NewerOlder