MAW-873 Prevent Periodic 404 Errors

This commit is contained in:
Roger McCoy
2024-03-01 15:39:06 +00:00
committed by Andrew Bastin
parent ed1533dc69
commit 9bc76e289d
8 changed files with 8 additions and 1788 deletions

View File

@@ -658,42 +658,18 @@ function theme_scripts() {
return $columns;
}
add_action('manage_posts_custom_column', 'manage_posts_custom_column_callback', 10, 2);
function manage_posts_custom_column_callback( $column_name, $post_id ) {
global $post;
add_action( 'manage_posts_custom_column', 'rachel_carden_populating_my_posts_columns', 10, 2 );
function rachel_carden_populating_my_posts_columns( $column_name, $post_id ) {
global $wpdb, $post;
if(get_post_meta($post->ID, 'order_priority', true)=='' || get_post_meta($post->ID, 'order_priority', true)==' '){
add_post_meta($post->ID, 'order_priority', '-');
update_post_meta($post->ID, 'order_priority', '-');}
$a = $wpdb->prepare("call IPER_MA_PRODUCT_BY_WP_RATEPLAN_ID(%d)", $post_id);
$b = callDBStored($a);
$product_wp_id = $b[0]->idPRODUCT_WP;
$product_wp_id_title = get_post($product_wp_id)->post_title;
$c = $wpdb->prepare("call IPER_MA_PRODUCT_BY_WP_UPSELL_ID(%d)", $post_id);
$d = callDBStored($c);
$rateplan_wp_id = $d[0]->idRATEPLAN_WP;
$rateplan_wp_id_title = get_post($rateplan_wp_id)->post_title;
$product_wp_id_upsell = $d[0]->idPRODUCT_WP;
$product_wp_id_title_upsell = get_post($product_wp_id_upsell)->post_title;
if (get_post_meta($post->ID, 'order_priority', true) == '' || get_post_meta($post->ID, 'order_priority', true) == ' ') {
add_post_meta($post->ID, 'order_priority', '-');
update_post_meta($post->ID, 'order_priority', '-');
}
$post_id = sanitize_text_field($post_id);
add_post_meta($post_id, 'product_rateplan', $product_wp_id_title);
update_post_meta($post_id, 'product_rateplan', $product_wp_id_title);
add_post_meta($post_id, 'rateplan_upsell', $rateplan_wp_id_title);
update_post_meta($post_id, 'rateplan_upsell', $rateplan_wp_id_title);
add_post_meta($post_id, 'product_upsell', $product_wp_id_title_upsell);
update_post_meta($post_id, 'product_upsell', $product_wp_id_title_upsell);
switch( $column_name ) {
switch ($column_name) {
case 'product_rateplan':
echo '<div id="' . $post_id . '">' . get_post_meta($post_id, 'product_rateplan', true) . '</div>';
break;
@@ -709,8 +685,6 @@ function theme_scripts() {
}
}
add_filter('manage_edit-rateplan_sortable_columns', 'tcb_register_rateplan_sortable_columns');
add_filter('manage_edit-upsell_sortable_columns', 'tcb_register_upsell_sortable_columns');
add_filter('manage_edit-product_sortable_columns', 'tcb_register_product_sortable_columns');