Afdelingen CPT

// Registreer Custom Post Type: Afdelingen function registreer_afdelingen_post_type() { $labels = array( ‘name’ => _x(‘Afdelingen’, ‘Post Type Algemene Naam’, ‘textdomain’), ‘singular_name’ => _x(‘Afdeling’, ‘Post Type Enkelvoudige Naam’, ‘textdomain’), ‘menu_name’ => __(‘Afdelingen’, ‘textdomain’), ‘name_admin_bar’ => __(‘Afdeling’, ‘textdomain’), ‘archives’ => __(‘Afdeling archieven’,…Continue reading

Medewerkers / collega’s CPT

// Registreer Custom Post Type: Medewerkers function registreer_medewerkers_post_type() { $labels = array( ‘name’ => _x(‘Medewerkers’, ‘Post Type Algemene Naam’, ‘textdomain’), ‘singular_name’ => _x(‘Medewerker’, ‘Post Type Enkelvoudige Naam’, ‘textdomain’), ‘menu_name’ => __(‘Medewerkers’, ‘textdomain’), ‘name_admin_bar’ => __(‘Medewerker’, ‘textdomain’), ‘archives’ => __(‘Medewerker archieven’,…Continue reading

Make Elementor Default Editor

/** * Comprehensive solution to make Elementor the default editor * while keeping the “Edit with Elementor” option */ /** * Redirect default WordPress editor to Elementor editor */ function redirect_default_editor_to_elementor() { global $pagenow; // Check if we’re on the…Continue reading

MemberPress: Code Blocks Pro – Load All Currently Enqueued Styles In the Courses ReadyLaunch Template

function my_theme_enqueue_scripts() { wp_enqueue_style( ‘code-block’, ‘https://yourdomain.com/wp-content/plugins/code-block-pro/src/front/style.css’, [], ‘1.0.0’, ‘all’ ); wp_enqueue_style( ‘code-block-font’, ‘https://yourdomain.com/wp-content/plugins/code-block-pro/build/fonts/Code-Pro-JetBrains-Mono-NL.ttf’, [], ‘1.0.0’, ‘all’ ); wp_enqueue_style( ‘code-block-css’, ‘https://yourdomain.com/wp-content/plugins/code-block-pro/build/style-index.css’, [], ‘1.0.0’, ‘all’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_scripts’ ); add_filter(‘mpcs_classroom_style_handles’, function($allowed_handles){ $allowed_handles[] = ‘code-block’; $allowed_handles[] = ‘code-block-font’; $allowed_handles[] = ‘code-block-css’;…Continue reading

Ultimate Member Fallback Value

/** * Displays fallback value if the field value is empty. For the “view” mode only. * @param string $value * @param string $default * @param string $key * @param string $type * @param array $data * @return string */…Continue reading

Pipeline API Auto Sync

add_action(‘init’, ‘pipeline_save_api_data_to_static_json’); function pipeline_save_api_data_to_static_json() { if (!is_main_query() || !is_admin()) return; if (isset($_GET[‘run_pipeline_sync’]) && current_user_can(‘manage_options’)) { pipeline_run_api_sync(); exit(‘Sync completed’); } } function pipeline_run_api_sync() { $auth_url = ‘https://pipeline-wp-api.locallabs.com/api/v2/authenticate’; $email = defined(‘PIPELINE_API_EMAIL’) ? PIPELINE_API_EMAIL : ”; $password = defined(‘PIPELINE_API_PASSWORD’) ? PIPELINE_API_PASSWORD : ”;…Continue reading

Breeze Auto Cache Clear > Wp All Import

add_action(‘pmxi_saved_post’, ‘trigger_breeze_secure_cache_purge’, 10, 1); function trigger_breeze_secure_cache_purge($post_id) { $url = home_url(‘/wp-json/breeze/v1/purge’); $response = wp_remote_post($url, [ ‘headers’ => [ ‘Content-Type’ => ‘application/json’, ‘Authorization’ => ‘Bearer NH1QZ2zi0aef’, // your Breeze API key ], ‘body’ => json_encode([ ‘urls’ => [get_permalink($post_id)], // optional: purge only…Continue reading

Staging Subscriber Redirect

function redirect_subscribers_to_home( $redirect_to, $request, $user ) { // Check if user is logged in and is a subscriber if ( isset( $user->roles ) && is_array( $user->roles ) && in_array( ‘subscriber’, $user->roles ) ) { return home_url(); // Redirect to homepage…Continue reading

Add Image Alt Text automatic (copy) (copy)

function add_alt_text_to_images( $html ) { // Check if the image has a title attribute if ( preg_match( ‘/(title=[“‘].*?[“‘])/’, $html, $matches ) ) { // Get the title $title = substr( $matches[0], 7, -1 ); // Check if the image has…Continue reading

Add Image Alt Text automatic (copy)

function add_alt_text_to_images( $html ) { // Check if the image has a title attribute if ( preg_match( ‘/(title=[“‘].*?[“‘])/’, $html, $matches ) ) { // Get the title $title = substr( $matches[0], 7, -1 ); // Check if the image has…Continue reading