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

Fix with '_featured' and '_filled' meta on duplicated posts #2839

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 0 additions & 4 deletions includes/admin/class-wp-job-manager-writepanels.php
Original file line number Diff line number Diff line change
@@ -673,10 +673,6 @@ public function save_post( $post_id, $post ) {
public function save_job_listing_data( $post_id, $post ) {
global $wpdb;

// These need to exist.
add_post_meta( $post_id, '_filled', 0, true );
add_post_meta( $post_id, '_featured', 0, true );

// Save fields.
foreach ( $this->job_listing_fields() as $key => $field ) {
if ( isset( $field['type'] ) && 'info' === $field['type'] ) {
2 changes: 1 addition & 1 deletion includes/class-wp-job-manager-post-types.php
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ public function __construct() {
add_filter( 'wp_insert_post_data', [ $this, 'fix_post_name' ], 10, 2 );
add_action( 'add_post_meta', [ $this, 'maybe_add_geolocation_data' ], 10, 3 );
add_action( 'update_post_meta', [ $this, 'update_post_meta' ], 10, 4 );
add_action( 'wp_insert_post', [ $this, 'maybe_add_default_meta_data' ], 10, 2 );
add_action( 'wp_after_insert_post', [ $this, 'maybe_add_default_meta_data' ], 10, 2 );
add_filter( 'post_types_to_delete_with_user', [ $this, 'delete_user_add_job_listings_post_type' ] );

add_action( 'transition_post_status', [ $this, 'track_job_submission' ], 10, 3 );
4 changes: 0 additions & 4 deletions includes/forms/class-wp-job-manager-form-submit-job.php
Original file line number Diff line number Diff line change
@@ -970,10 +970,6 @@ protected function create_attachment( $attachment_url ) {
* @param array $values
*/
protected function update_job_data( $values ) {
// Set defaults.
add_post_meta( $this->job_id, '_filled', 0, true );
add_post_meta( $this->job_id, '_featured', 0, true );

$maybe_attach = [];

// Loop fields and save meta and term data.
2 changes: 1 addition & 1 deletion wp-job-manager.php
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
}

// Define constants.
define( 'JOB_MANAGER_VERSION', '2.3.0' );
define( 'JOB_MANAGER_VERSION', '2.3.0-dev' );
define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
define( 'JOB_MANAGER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );