diff --git a/changelog.txt b/changelog.txt index 6bc22c6f..3628ee69 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ += 1.3 - 2020-02-10 = +* Added - Expiry date column. + = 1.2.9.4 - 2020-02-05 = * Fixes - Login with Edior role. diff --git a/inc/admin/property/class-property.php b/inc/admin/property/class-property.php index 77b90964..4ceb89cd 100755 --- a/inc/admin/property/class-property.php +++ b/inc/admin/property/class-property.php @@ -38,12 +38,12 @@ class Opalestate_Admin_Property { // add_action( 'transition_post_status', array( __CLASS__, 'save_post' ), 10, 3 ); } - + /** * */ - public static function save_post( $new_status, $old_status, $post ){ - if ( $new_status == 'publish' && $post->post_type == "opalestate_property" ) { + public static function save_post( $new_status, $old_status, $post ) { + if ( $new_status == 'publish' && $post->post_type == "opalestate_property" ) { $user_id = $post->post_author; $user = get_user_by( 'id', $user_id ); if ( ! is_object( $user ) ) { @@ -103,6 +103,7 @@ class Opalestate_Admin_Property { $columns['comments'] = $comments; $columns['author'] = esc_html__( 'Author', 'opalestate-pro' ); $columns['date'] = esc_html__( 'Date', 'opalestate-pro' ); + $columns['expiry_date'] = esc_html__( 'Expiry Date', 'opalestate-pro' ); return $columns; } @@ -148,6 +149,15 @@ class Opalestate_Admin_Property { } break; + case 'expiry_date': + if ( $property->get_expiry_date() ) { + $expired_time = $property->get_expiry_date(); + echo date_i18n( __( 'Y/m/d g:i:s a', 'opalestate-pro' ), $expired_time ); + } else { + echo esc_html_x( '---', 'expired property', 'opalestate-pro' ); + } + break; + default: # code... break; diff --git a/inc/property/class-opalestate-property.php b/inc/property/class-opalestate-property.php index f3b498fc..dbcae9ec 100755 --- a/inc/property/class-opalestate-property.php +++ b/inc/property/class-opalestate-property.php @@ -740,4 +740,11 @@ class Opalestate_Property { public function get_posted() { return human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) . ' ' . esc_html__( 'ago' ); } + + public function get_expiry_date() { + $expired_activated = get_post_meta( $this->get_id(), OPALESTATE_PROPERTY_PREFIX . 'expired_activated', true ); + $expired_time = get_post_meta( $this->get_id(), OPALESTATE_PROPERTY_PREFIX . 'expired_time', true ); + + return ( $expired_activated && $expired_time ) ? $expired_time : ''; + } } diff --git a/opal-estate-pro.php b/opal-estate-pro.php index 9bb20a76..657dd450 100755 --- a/opal-estate-pro.php +++ b/opal-estate-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Opal Estate Pro * Plugin URI: https://wpdocs.gitbook.io/opal-estate/ * Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website. - * Version: 1.2.9.4 + * Version: 1.3 * Author: WPOPAL * Author URI: http://www.wpopal.com * Requires at least: 4.9 @@ -150,7 +150,7 @@ if ( ! class_exists( 'OpalEstate' ) ) { */ public function __clone() { // Cloning instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.2.9.4' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.3' ); } /** @@ -159,7 +159,7 @@ if ( ! class_exists( 'OpalEstate' ) ) { public function setup_constants() { // Plugin version if ( ! defined( 'OPALESTATE_VERSION' ) ) { - define( 'OPALESTATE_VERSION', '1.2.9.4' ); + define( 'OPALESTATE_VERSION', '1.3' ); } // Plugin Folder Path diff --git a/readme.txt b/readme.txt index 16459470..c5be0e2a 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://wpdocs.gitbook.io/opal-estate/ Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace Requires at least: 4.9 Tested up to: 5.3.2 -Stable tag: 1.2.9.4 +Stable tag: 1.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -156,6 +156,9 @@ This section describes how to install the plugin and get it working. * System tickets support 24/7 available : [free support](https://wpopal.ticksy.com/ "Visit the Plugin support Page") == Changelog == += 1.3 - 2020-02-10 = +* Added - Expiry date column. + = 1.2.9.4 - 2020-02-05 = * Fixes - Login with Edior role.