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 | |
/** | |
* Custom shortcode callback function | |
* | |
* @param array $atts | |
* @param string $content | |
* @return string | |
*/ | |
function my_shortcode_callback( $atts = array(), $content = '' ) { |
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 | |
/** | |
* Filter an array based on a white list of keys | |
* | |
* @param array $array | |
* @param array $keys | |
* @return array | |
*/ | |
function array_keys_white_list( array $array, array $keys ) { |
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 | |
/** | |
* Filter an array based on a black list of keys | |
* | |
* @param array $array | |
* @param array $keys | |
* @return array | |
*/ | |
function array_keys_black_list( array $array, array $keys ) { |
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 | |
/** | |
* Properly set the timezone in WordPress | |
* | |
* @param string $timezone | |
*/ | |
public static function set_timezone( $timezone = '' ) { | |
if ( empty( $timezone ) ) { | |
$timezone = get_option( 'timezone_string', date_default_timezone_get() ); |
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 | |
/** | |
* Load Ember templates in WordPress | |
*/ | |
public static function load_views() { | |
$iterator = new \DirectoryIterator( plugin_dir_path( __FILE__ ) . 'views' ); | |
foreach ( $iterator as $file ) { | |
/** | |
* @var \SplFileInfo $file |
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 | |
$mime_type = sanitize_mime_type( $_FILES['upload']['type'] ); | |
update_post_meta( get_the_ID(), 'mime_type', $mime_type ); |
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 | |
$url = esc_url_raw( $_POST['url'] ); | |
update_post_meta( get_the_ID(), 'url', $url ); |
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 | |
$email = sanitize_email( $_POST['email'] ); | |
update_post_meta( get_the_ID(), 'email', $email ); |
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 | |
$slug = sanitize_title( $_POST['title'], 'untitled' ); | |
update_post_meta( get_the_ID(), 'slug', $slug ); |
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 | |
$title = sanitize_text_field( $_POST['title'] ); | |
update_post_meta( get_the_ID(), 'title', $title ); |
OlderNewer