add_action(‘woocommerce_admin_order_data_after_order_details’, ‘add_custom_shipping_method_backend’); function add_custom_shipping_method_backend($order_id) { // Manually get the order object $order = wc_get_order($order_id); if (!$order || !is_a($order, ‘WC_Order’)) { echo ‘ Error: Order is invalid. Please reload the page or check your setup. ‘; return; } ?> Royal Mail…Continue reading
class PIM_Metaboxes { public function __construct() { add_action( ‘admin_init’, array($this, ‘add_metaboxes’) ); add_action( ‘save_post’, array($this, ‘save_metabox_data’), 10 , 3 ); add_action( ‘admin_enqueue_scripts’, array($this, ‘category_enqueue_scripts’) ); add_action(‘pa_brand_add_form_fields’, array($this, ‘add_pa_brand_fields’), 10, 2 ); add_action(‘pa_brand_edit_form_fields’, array($this, ‘edit_pa_brand_fields’), 10, 2 ); // Voor pa_merk…Continue reading
add_filter( ‘manage_edit-product_columns’, ‘descriptions_product_column’, 10); add_filter( ‘manage_edit-product_sortable_columns’, ‘descriptions_product_sortable_column’, 10); add_action( ‘manage_product_posts_custom_column’, ‘descriptions_product_column_content’, 10, 2 ); function descriptions_product_column($columns){ $new_columns = []; foreach( $columns as $key => $column ){ $new_columns[$key] = $columns[$key]; if( $key == ‘price’ ) { $new_columns[‘short_description’] = ‘Korte omschrijving’; $new_columns[‘content’]…Continue reading
/** * Custom metaboxes voor WooCommerce producten */ add_action(‘add_meta_boxes’, function () { add_meta_box( ‘custom_metabox_highlighted_product’, ‘Uitgelicht product’, ‘highlighted_product_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); add_meta_box( ‘custom_metabox_remarks’, ‘Beoordeling’, ‘product_remarks_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); add_meta_box( ‘custom_metabox_video’, ‘Product video’, ‘product_video_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); }); function…Continue reading
class PIM_Metaboxes { public function __construct() { add_action( ‘admin_init’, array($this, ‘add_metaboxes’) ); add_action( ‘save_post’, array($this, ‘save_metabox_data’), 10 , 3 ); add_action( ‘admin_enqueue_scripts’, array($this, ‘category_enqueue_scripts’) ); add_action(‘pa_brand_add_form_fields’, array($this, ‘add_pa_brand_fields’), 10, 2 ); add_action(‘pa_brand_edit_form_fields’, array($this, ‘edit_pa_brand_fields’), 10, 2 ); // Voor pa_merk…Continue reading
//Remove all admin dashboard widgets add_action(‘wp_dashboard_setup’, ‘remove_all_dashboard_widgets’, 100 ); function remove_all_dashboard_widgets() { global $wp_meta_boxes; $wp_meta_boxes = []; } //Add custom ones add_action(‘wp_dashboard_setup’, ‘my_dashboard_widgets’, 999); function my_dashboard_widgets() { wp_add_dashboard_widget( ‘my_dashboard_widget’, // Widget slug ‘Uitleg Antilope webshops’, // Widget title ‘my_dashboard_widget_content’ //…Continue reading
function calcular_valor_do_repeater_acf( $post_id ) { $etapas = ‘etapas’; $tarefas = ‘tarefas’; $checkbox = ‘feito’; $progresso_etapa = ‘progresso_da_etapa’; $progresso_projeto = ‘progresso_do_projeto’; // Check rows exists. if( have_rows($etapas) ): $rows_etapas = 0; $progress_etapas = 0; while( have_rows($etapas) ) : the_row(); // Loop…Continue reading
/************* Change dashboard post to Investering *************/ add_action( ‘init’, ‘cp_change_post_object’ ); function cp_change_post_object() { $get_post_type = get_post_type_object(‘post’); $labels = $get_post_type->labels; $labels->name = ‘Investeringer’; $labels->singular_name = ‘Investering’; $labels->add_new_item = ‘Legg til investering’; $labels->edit_item = ‘Rediger investering’; $labels->new_item = ‘Ny investering’; $labels->view_item…Continue reading
function register_expired_post_status() { register_post_status(‘expired’, array( ‘label’ => _x(‘Utgått’, ‘post’), ‘public’ => false, ‘exclude_from_search’ => true, ‘show_in_admin_all_list’ => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop(‘Utgått (%s)‘, ‘Utgåtte (%s)‘), )); } add_action(‘init’, ‘register_expired_post_status’); function add_expired_to_post_status_dropdown() { echo ‘‘; } add_action(‘admin_footer-post.php’, ‘add_expired_to_post_status_dropdown’); add_action(‘admin_footer-post-new.php’,…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading