Cleaned up execution hooks and removed some non-functional code from the ceo-admin.php

Redid the start of the clearprice for buyprint, will make it a button in the future
This commit is contained in:
Frumph
2015-08-24 23:21:03 -07:00
parent 1cafb36caa
commit bbeb02e7c0
2 changed files with 22 additions and 28 deletions

View File

@@ -3,23 +3,30 @@
// actions
add_action('admin_menu', 'ceo_add_menu_pages');
add_action('admin_enqueue_scripts', 'ceo_comic_editor_scripts', 10, 1 );
if (ceo_pluginfo('add_dashboard_frumph_feed_widget'))
add_action('wp_dashboard_setup', 'ceo_add_dashboard_widgets' );
function ceo_comic_editor_scripts( $hook ) {
global $post;
if (!empty($post)) {
if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
global $pagenow, $post;
if (!empty($pagenow)) {
/*
if ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) {
if ('comic' === $post->post_type) {
wp_enqueue_script('ceo-upload-flash', ceo_pluginfo('plugin_url').'js/upload-flash.js');
wp_enqueue_media();
}
}
if ($hook == 'edit.php') {
if ($pagenow == 'edit.php') {
if ('comic' == $post->post_type) {
add_action('admin_footer', 'ceo_change_chapter_to_radio');
}
}
if ($pagenow == 'edit-tags.php') {
wp_enqueue_script('ceo-inline-edit', ceo_pluginfo('plugin_url').'js/custom_inline_edit_tax.dev.js');
}
*/
}
}
@@ -130,21 +137,3 @@ function ceo_enqueue_admin_cpt_style( $cpt, $handle, $src = false, $deps = array
}
/*
// Dysfunctional Code
function ceo_comic_shortlinks( $shortlink, $id, $context, $allow_slugs=true ) {
var_dump($context);
if (('post' == $context) && !$shortlink) {
if (function_exists('wpme_get_shortlink')) {
$blog_id = Jetpack_Options::get_option( 'id' );
$type= 'p';
$shortlink = 'http://wp.me/' . wpme_dec2sixtwo( $id );
var_dump($shortlink);
} else {
$shortlink = home_url('?p='.$post->ID);
}
}
return $shortlink;
}
*/

View File

@@ -258,11 +258,16 @@ if (isset($_GET['clearprice']))
add_action('template_redirect', 'ceo_clearprice');
function ceo_clearprice() {
global $wpdb;
$sql = "DELETE * FROM {$wpdb->postmeta} where meta_key = 'buy_print_amount'";
$wpdb->query($sql);
$sql = "DELETE * FROM {$wpdb->postmeta} where meta_key = 'buy_print_orig_amount'";
$wpdb->query($sql);
exit;
$post_args = array(
'showposts' => -1,
'post_type' => 'comic',
'order' => 'ASC'
);
$qposts = get_posts( $post_args );
foreach($qposts as $qpost) {
delete_post_meta($qpost->ID, 'buy_print_orig_amount');
}
}
// exit;
*/