Skip to content

Commit 42707dd

Browse files
authored
Merge pull request #658 from CodingBlackFemales/develop
Preserves job listing company icons during import
2 parents a413492 + 4cbd206 commit 42707dd

File tree

9 files changed

+56
-28
lines changed

9 files changed

+56
-28
lines changed

.lando.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ config:
55
php: '8.2'
66
via: apache
77
webroot: web
8-
xdebug: true
8+
xdebug: false
99
config:
1010
php: .lando/config/php/php.ini
1111
# Multisite networks must have each site listed below to work under lando
@@ -57,8 +57,18 @@ tooling:
5757
npm:
5858
service: appserver
5959
# https://github.com/lando/lando/issues/1668#issuecomment-772829423
60-
xdebug:
61-
description: Loads XDebug in the selected mode.
60+
xdebug-on:
61+
service: appserver
62+
description: Enable Xdebug.
63+
user: root
6264
cmd:
63-
- appserver: /app/.lando/scripts/xdebug.sh
65+
- docker-php-ext-enable xdebug && kill -USR2 $(pgrep -o php-fpm) > /dev/null || /etc/init.d/apache2 reload
66+
- tput setaf 2 && echo "Xdebug On" && tput sgr 0 && echo
67+
68+
xdebug-off:
69+
service: appserver
70+
description: Disable Xdebug.
6471
user: root
72+
cmd:
73+
- 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
74+
- tput setaf 1 && echo "Xdebug Off" && tput sgr 0 && echo

.lando/scripts/xdebug.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"name": "Listen for XDebug (Lando)",
66
"type": "php",
77
"request": "launch",
8-
"hostname": "127.0.0.1",
98
"port": 9003,
10-
"log": false,
119
"pathMappings": {
1210
"/app/": "${workspaceFolder}/",
1311
},

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
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.
44

5+
## [0.1.33](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.32...v0.1.33) (2024-11-23)
6+
7+
8+
### Bug Fixes
9+
10+
* prevents duplicate result import ([45032f7](https://github.com/CodingBlackFemales/wordpress/commit/45032f72c1dfcdd365129e55b10ed8b51a7b5e55))
11+
* prevents duplicate result import ([cf27c22](https://github.com/CodingBlackFemales/wordpress/commit/cf27c224a97d09528ec2f5488f1906cb2a58eccb))
12+
513
## [0.1.32](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.31...v0.1.32) (2024-09-16)
614

715
## [0.1.31](https://github.com/CodingBlackFemales/wordpress/compare/v0.1.30...v0.1.31) (2024-08-19)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cbf-wordpress",
3-
"version": "0.1.32",
3+
"version": "0.1.33",
44
"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)",
55
"devDependencies": {
66
"@commitlint/cli": "^19.0",

web/app/plugins/cbf-multisite/includes/Customizations/WP_Job_Manager.php

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
namespace CodingBlackFemales\Multisite\Customizations;
1111

12+
use CodingBlackFemales\Multisite\Utils;
13+
1214
if ( ! defined( 'ABSPATH' ) ) {
1315
exit;
1416
}
@@ -56,12 +58,36 @@ public static function resume_manager_update_resume_data( $resume_id ) {
5658
}
5759
}
5860

61+
/**
62+
* Prevent job listing company thumbnails from being deleted during import.
63+
*
64+
* @param bool $is_images_to_update
65+
* @param array $article_data
66+
* @param string $current_xml_node
67+
* @param int $pid
68+
*
69+
* @return bool
70+
*/
71+
public static function preserve_job_listing_images( $is_images_to_update, $article_data, $current_xml_node, $pid ) {
72+
if ( $article_data['post_type'] === 'job_listing' ) {
73+
$is_images_to_update = false;
74+
}
75+
76+
return $is_images_to_update;
77+
}
78+
5979
/**
6080
* Hook in methods.
6181
*/
6282
public static function hooks() {
63-
add_filter( 'submit_resume_steps', array( __CLASS__, 'submit_resume_steps' ) );
64-
add_filter( 'submit_resume_form_submit_button_text', array( __CLASS__, 'submit_resume_form_submit_button_text' ) );
65-
add_action( 'resume_manager_update_resume_data', array( __CLASS__, 'resume_manager_update_resume_data' ) );
83+
if ( Utils::is_request( 'admin' ) ) {
84+
add_filter( 'pmxi_is_images_to_update', array( __CLASS__, 'preserve_job_listing_images' ), 10, 4 );
85+
}
86+
87+
if ( Utils::is_request( 'frontend' ) ) {
88+
add_filter( 'submit_resume_steps', array( __CLASS__, 'submit_resume_steps' ) );
89+
add_filter( 'submit_resume_form_submit_button_text', array( __CLASS__, 'submit_resume_form_submit_button_text' ) );
90+
add_action( 'resume_manager_update_resume_data', array( __CLASS__, 'resume_manager_update_resume_data' ) );
91+
}
6692
}
6793
}

web/app/plugins/cbf-multisite/includes/Front/Main.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace CodingBlackFemales\Multisite\Front;
1111

12-
use CodingBlackFemales\Multisite\Customizations\WP_Job_Manager;
13-
1412
if ( ! defined( 'ABSPATH' ) ) {
1513
exit;
1614
}
@@ -27,7 +25,6 @@ final class Main {
2725
*/
2826
public static function hooks() {
2927
Assets::hooks();
30-
WP_Job_Manager::hooks();
3128
add_action( 'init', array( __CLASS__, 'customise_error_reporting' ) );
3229
}
3330

web/app/plugins/cbf-multisite/includes/Main.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use CodingBlackFemales\Multisite\Front\Main as Front;
1313
use CodingBlackFemales\Multisite\Customizations\Quiz_Results_Command;
1414
use CodingBlackFemales\Multisite\Customizations\WP_Cron;
15+
use CodingBlackFemales\Multisite\Customizations\WP_Job_Manager;
1516

1617

1718
/**
@@ -77,6 +78,7 @@ public static function load() {
7778
}
7879

7980
WP_Cron::hooks();
81+
WP_Job_Manager::hooks();
8082

8183
if ( Utils::is_request( 'admin' ) ) {
8284
Admin::hooks();

0 commit comments

Comments
 (0)