PHP: Backend to Handle Single Image Deletion

// Register REST routes add_action(‘rest_api_init’, function () { register_rest_route(‘wp/v2’, ‘/delete-image’, [ ‘methods’ => ‘POST’, ‘callback’ => ‘chicpinups_delete_image’, ‘permission_callback’ => function (WP_REST_Request $request) { return chicpinups_check_api_key($request); }, ]); }); // Function to delete images and update metadata if (!function_exists(‘chicpinups_delete_image’)) { function…Continue reading

Change from e-mail address

//aanpassen afzender bij registratie etc /** change from e-mail address */ add_filter(‘wp_mail_from’, ‘new_mail_from’); add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’); function new_mail_from($old) { return ‘[email protected]’; } function new_mail_from_name($old) { return ‘D\’Amore – de bruidssalon voor Amersfoort en Arnhem’; }Continue reading

Enable Zooming in Website

function remove_my_meta_viewport_action() { remove_action(‘wp_head’, ‘et_add_viewport_meta’); } function custom_et_add_viewport_meta(){ echo ‘‘; } add_action( ‘init’, ‘remove_my_meta_viewport_action’); add_action( ‘wp_head’, ‘custom_et_add_viewport_meta’ );Continue reading

PHP: User Render Gallery V4

function render_user_gallery() { if (!is_user_logged_in()) { error_log(“[GALLERY] User not logged in.”); return ‘ You must be logged in to view your gallery. ‘; } $current_user = wp_get_current_user(); $user_id = $current_user->ID; error_log(“[GALLERY] Current user ID: $user_id”); $upload_dir = wp_upload_dir(); $user_dir =…Continue reading

Remove weight from PDF invoices

/** * Hide weight from PDF invoices */ add_action( ‘wpo_wcpdf_custom_styles’, function( $document_type, $document ) { if ( $order = $document->order ) { ?> .meta .weight { display: none; }Continue reading