diff --git a/.lando.yml b/.lando.yml index 95bc505e..02868d05 100644 --- a/.lando.yml +++ b/.lando.yml @@ -5,7 +5,7 @@ config: php: '8.2' via: apache webroot: web - xdebug: true + xdebug: false config: php: .lando/config/php/php.ini # Multisite networks must have each site listed below to work under lando @@ -57,8 +57,18 @@ tooling: npm: service: appserver # https://github.com/lando/lando/issues/1668#issuecomment-772829423 - xdebug: - description: Loads XDebug in the selected mode. + xdebug-on: + service: appserver + description: Enable Xdebug. + user: root cmd: - - appserver: /app/.lando/scripts/xdebug.sh + - docker-php-ext-enable xdebug && kill -USR2 $(pgrep -o php-fpm) > /dev/null || /etc/init.d/apache2 reload + - tput setaf 2 && echo "Xdebug On" && tput sgr 0 && echo + + xdebug-off: + service: appserver + description: Disable Xdebug. user: root + cmd: + - rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && kill -USR2 $(pgrep -o php-fpm) > /dev/null || /etc/init.d/apache2 reload + - tput setaf 1 && echo "Xdebug Off" && tput sgr 0 && echo diff --git a/.lando/scripts/xdebug.sh b/.lando/scripts/xdebug.sh deleted file mode 100755 index daa0565f..00000000 --- a/.lando/scripts/xdebug.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [ "$#" -ne 1 ]; then - echo "Xdebug has been turned off, please use the following syntax: 'lando xdebug '." - echo "Valid modes: https://xdebug.org/docs/all_settings#mode." - echo xdebug.mode = off > /usr/local/etc/php/conf.d/zzz-lando-xdebug.ini - pkill -o -USR2 php-fpm -else - mode="$1" - echo xdebug.mode = "$mode" > /usr/local/etc/php/conf.d/zzz-lando-xdebug.ini - pkill -o -USR2 php-fpm - echo "Xdebug is loaded in "$mode" mode." -fi diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d5a88ff..23a37bab 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,9 +5,7 @@ "name": "Listen for XDebug (Lando)", "type": "php", "request": "launch", - "hostname": "127.0.0.1", "port": 9003, - "log": false, "pathMappings": { "/app/": "${workspaceFolder}/", }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7dbf7d..f9b9d74b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [0.1.33](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.32...v0.1.33) (2024-11-23) + + +### Bug Fixes + +* prevents duplicate result import ([45032f7](https://github.com/CodingBlackFemales/wordpress/commit/45032f72c1dfcdd365129e55b10ed8b51a7b5e55)) +* prevents duplicate result import ([cf27c22](https://github.com/CodingBlackFemales/wordpress/commit/cf27c224a97d09528ec2f5488f1906cb2a58eccb)) + ## [0.1.32](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.31...v0.1.32) (2024-09-16) ## [0.1.31](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.30...v0.1.31) (2024-08-19) diff --git a/package-lock.json b/package-lock.json index e095a111..6acfffd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cbf-wordpress", - "version": "0.1.32", + "version": "0.1.33", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cbf-wordpress", - "version": "0.1.32", + "version": "0.1.33", "devDependencies": { "@commitlint/cli": "^19.0", "@commitlint/config-conventional": "^19.0", diff --git a/package.json b/package.json index 5b1b940a..d9fb6d3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cbf-wordpress", - "version": "0.1.32", + "version": "0.1.33", "description": "[![Packagist](https://img.shields.io/packagist/v/roots/bedrock.svg?style=flat-square)](https://packagist.org/packages/roots/bedrock) [![Build Status](https://img.shields.io/travis/roots/bedrock.svg?style=flat-square)](https://travis-ci.org/roots/bedrock)", "devDependencies": { "@commitlint/cli": "^19.0", diff --git a/web/app/plugins/cbf-multisite/includes/Customizations/WP_Job_Manager.php b/web/app/plugins/cbf-multisite/includes/Customizations/WP_Job_Manager.php index 3bdd2720..660fc261 100644 --- a/web/app/plugins/cbf-multisite/includes/Customizations/WP_Job_Manager.php +++ b/web/app/plugins/cbf-multisite/includes/Customizations/WP_Job_Manager.php @@ -9,6 +9,8 @@ namespace CodingBlackFemales\Multisite\Customizations; +use CodingBlackFemales\Multisite\Utils; + if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -56,12 +58,36 @@ public static function resume_manager_update_resume_data( $resume_id ) { } } + /** + * Prevent job listing company thumbnails from being deleted during import. + * + * @param bool $is_images_to_update + * @param array $article_data + * @param string $current_xml_node + * @param int $pid + * + * @return bool + */ + public static function preserve_job_listing_images( $is_images_to_update, $article_data, $current_xml_node, $pid ) { + if ( $article_data['post_type'] === 'job_listing' ) { + $is_images_to_update = false; + } + + return $is_images_to_update; + } + /** * Hook in methods. */ public static function hooks() { - add_filter( 'submit_resume_steps', array( __CLASS__, 'submit_resume_steps' ) ); - add_filter( 'submit_resume_form_submit_button_text', array( __CLASS__, 'submit_resume_form_submit_button_text' ) ); - add_action( 'resume_manager_update_resume_data', array( __CLASS__, 'resume_manager_update_resume_data' ) ); + if ( Utils::is_request( 'admin' ) ) { + add_filter( 'pmxi_is_images_to_update', array( __CLASS__, 'preserve_job_listing_images' ), 10, 4 ); + } + + if ( Utils::is_request( 'frontend' ) ) { + add_filter( 'submit_resume_steps', array( __CLASS__, 'submit_resume_steps' ) ); + add_filter( 'submit_resume_form_submit_button_text', array( __CLASS__, 'submit_resume_form_submit_button_text' ) ); + add_action( 'resume_manager_update_resume_data', array( __CLASS__, 'resume_manager_update_resume_data' ) ); + } } } diff --git a/web/app/plugins/cbf-multisite/includes/Front/Main.php b/web/app/plugins/cbf-multisite/includes/Front/Main.php index 5ac5e52b..c15c80be 100644 --- a/web/app/plugins/cbf-multisite/includes/Front/Main.php +++ b/web/app/plugins/cbf-multisite/includes/Front/Main.php @@ -9,8 +9,6 @@ namespace CodingBlackFemales\Multisite\Front; -use CodingBlackFemales\Multisite\Customizations\WP_Job_Manager; - if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -27,7 +25,6 @@ final class Main { */ public static function hooks() { Assets::hooks(); - WP_Job_Manager::hooks(); add_action( 'init', array( __CLASS__, 'customise_error_reporting' ) ); } diff --git a/web/app/plugins/cbf-multisite/includes/Main.php b/web/app/plugins/cbf-multisite/includes/Main.php index 02112f86..5345dfd0 100644 --- a/web/app/plugins/cbf-multisite/includes/Main.php +++ b/web/app/plugins/cbf-multisite/includes/Main.php @@ -12,6 +12,7 @@ use CodingBlackFemales\Multisite\Front\Main as Front; use CodingBlackFemales\Multisite\Customizations\Quiz_Results_Command; use CodingBlackFemales\Multisite\Customizations\WP_Cron; +use CodingBlackFemales\Multisite\Customizations\WP_Job_Manager; /** @@ -77,6 +78,7 @@ public static function load() { } WP_Cron::hooks(); + WP_Job_Manager::hooks(); if ( Utils::is_request( 'admin' ) ) { Admin::hooks();