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 ebs_seo_cp_admin_init() { | |
wp_register_style('ebs_seo_cp_admin_stylesheet', plugins_url('admin-stylesheet.css', __FILE__)); | |
} | |
add_action( 'admin_init', 'ebs_seo_cp_admin_init' ); | |
function ebs_seo_cp_admin_enqueue($hook) { | |
$pages_array = array( | |
'ebs_seo_cp_menu', | |
'ebs_seo_cp_menu_view_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
function create_image_thumbnails($image_filename) { | |
$image = new Imagick("images/original/" . $image_filename); | |
$image->scaleImage(800,0); | |
$image_details = $image->getImageGeometry(); | |
if ($image_details['height'] > 600) { | |
$image->scaleImage(0,600); | |
} | |
$image->writeImage("images/normal/" . $image_filename); | |
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
$args = array( | |
'post_type' => 'post', | |
'post__not_in' => array($post->ID), | |
'tax_query' => array( | |
'relation' => 'OR', | |
array( | |
'taxonomy' => 'post_tag', | |
'field' => 'id', | |
'terms' => (array)$tag_ids, | |
'operator' => 'IN' |
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
$args = array( | |
'post_type' => 'my_image_post_type', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'body_part', | |
'field' => 'slug', | |
'terms' => 'arm' | |
) | |
) | |
); |
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
$args = array( | |
'post_type' => 'product', | |
'tax_query' => array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => $skinny | |
), | |
array( |
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
<? | |
function ebs_seo_cp_add_custom_box_contact() { | |
add_meta_box( | |
'ebs_seo_cp_meta_box_class_contact', //id | |
__( 'Location Details: Contact Information', 'ebs_seo_cp' ), //title | |
'ebs_seo_cp_inner_custom_box_contact', //callback | |
'location', //post type | |
'normal' //context | |
); | |
} |
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 ebs_seo_cp_sort_columns( $vars ) { | |
if ( isset( $vars['post_type'] ) && 'location' == $vars['post_type'] ) { | |
if ( isset( $vars['orderby'] ) ) { | |
switch ($vars['orderby'] ) { | |
case 'street' : | |
$vars = array_merge( |
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 | |
add_action('post_edit_form_tag', 'ebs_seo_cp_modify_form_tag'); | |
function ebs_seo_cp_modify_form_tag() { | |
echo '>'; | |
echo '<div>Testing added content to top of page</div'; | |
} | |
?> |
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 | |
add_action('post_edit_form_tag', 'ebs_seo_cp_modify_form_tag'); | |
function ebs_seo_cp_modify_form_tag() { | |
$screen = get_current_screen(); | |
if ( $screen->id != 'location') { return; } //change to custom post type | |
global $post; | |
//lets close the <form> tag | |
echo '>'; |
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 my_plugin_get_custom_fields($post_id) { | |
$data = get_post_custom($post_id); | |
foreach ($data as $k => $v) { | |
$return[$k] = $v[0]; | |
} | |
return $return; | |
} | |
$custom_fields = my_plugin_get_custom_fields($post_id); |
OlderNewer