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 | |
/** | |
* Get an array of post types for the options page multicheck array | |
* @uses get_post_types | |
* @return array An array of public post types | |
*/ | |
public function get_post_types() { | |
/** |
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 | |
if ( session_id() == '' ) | |
session_start(); | |
/** | |
* JW Post Types | |
* @author Jeffrey Way | |
* @link https://github.com/jazzsequence/Easy-WordPress-Custom-Post-Types | |
*/ | |
class WDS_Post_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 | |
$do_not_duplicate = array() // initialize the duplicates array. this will keep us from having duplicate posts in the results | |
/** | |
* set up an array of arguments to determine post2post relationships | |
* this stuff gets set up too late to be used in pre_get_posts so | |
* I have to use query_posts. | |
*/ | |
$query_args = array( | |
'connected_type' => 'songs_to_artists', |
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 filter_featured_images_from_videos( $content ) { | |
global $post; | |
$content .= get_post_meta( $post->ID, '_video_url', true ); | |
return $content; | |
} | |
add_filter( 'wds_featured_images_from_video_filter_content', 'filter_featured_images_from_videos' ); |
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 | |
// use the $_wp_additional_image_sizes global to fetch the dimensions of a given image size. | |
// this comes via Otto, who is amazing and knows everything: http://wordpress.stackexchange.com/a/28316 | |
function get_image_size( $size = 'thumbnail' ) { | |
global $_wp_additional_image_sizes; | |
$width = $_wp_additional_image_sizes[$size]['width']; | |
$height = $_wp_additional_image_sizes[$size]['height']; |
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
array( | |
"AF" => "Afghanistan (افغانستان)", | |
"AX" => "Åland Islands (Åland)", | |
"AL" => "Albania (Shqipëri)", | |
"DZ" => "Algeria (الجزائر)", | |
"AS" => "American Samoa", | |
"AD" => "Andorra", | |
"AO" => "Angola", | |
"AI" => "Anguilla", | |
"AQ" => "Antarctica", |
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 My_Class { | |
// some variable I want to use later | |
protected $var_a = ''; | |
// another variable I want to use later | |
protected $var_b = ''; | |
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 | |
/** | |
* Helper function to get a specific page by a page slug | |
* | |
* @param string $slug The slug to look for | |
* @param string $type What data you want returned. Takes anything that would be | |
* in a WP_Post object. Defaults to the full post object | |
* @link https://wordpress.org/support/topic/how-to-check-if-page-exists?replies=8#post-466937 | |
* @link http://stackoverflow.com/questions/14979837/wordpress-query-single-post-by-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 | |
/** | |
* Plugin Name: Roadkill One-time Cars to Posts Conversion | |
* Plugin URI: http://webdevstudios.com | |
* Description: Converts an array of car posts to WordPress posts. | |
* Version: 0.1.0 | |
* Author: WebDevStudios | |
* Author URI: http://webdevstudios.com | |
* Donate link: http://webdevstudios.com | |
* License: GPLv2 |
OlderNewer