Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserves job listing company icons during import #658

Merged
merged 6 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 0 additions & 13 deletions .lando/scripts/xdebug.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}/",
},
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace CodingBlackFemales\Multisite\Customizations;

use CodingBlackFemales\Multisite\Utils;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Expand Down Expand Up @@ -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' ) );
}
}
}
3 changes: 0 additions & 3 deletions web/app/plugins/cbf-multisite/includes/Front/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace CodingBlackFemales\Multisite\Front;

use CodingBlackFemales\Multisite\Customizations\WP_Job_Manager;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Expand All @@ -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' ) );
}

Expand Down
2 changes: 2 additions & 0 deletions web/app/plugins/cbf-multisite/includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -77,6 +78,7 @@ public static function load() {
}

WP_Cron::hooks();
WP_Job_Manager::hooks();

if ( Utils::is_request( 'admin' ) ) {
Admin::hooks();
Expand Down