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

Gallery Add New, Sorting (Drag n Drop) and Date Input Default Fix #410

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions lib/class-option-color.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function display() {
public function enqueueColorPickerScript() {
wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker-alpha', TitanFramework::getURL( '../js/min/wp-color-picker-alpha-min.js', __FILE__ ), array( 'wp-color-picker' ), TF_VERSION );
//wp_enqueue_script( 'wp-color-picker-alpha', TitanFramework::getURL( '../js/min/wp-color-picker-alpha-min.js', __FILE__ ), array( 'wp-color-picker' ), TF_VERSION );
}


Expand Down Expand Up @@ -123,7 +123,7 @@ function __construct( $manager, $id, $args = array() ) {

public function enqueue() {
parent::enqueue();
wp_enqueue_script( 'wp-color-picker-alpha', TitanFramework::getURL( '../js/min/wp-color-picker-alpha-min.js', __FILE__ ), array( 'wp-color-picker' ), TF_VERSION );
//wp_enqueue_script( 'wp-color-picker-alpha', TitanFramework::getURL( '../js/min/wp-color-picker-alpha-min.js', __FILE__ ), array( 'wp-color-picker' ), TF_VERSION );
}

public function to_json() {
Expand Down
21 changes: 20 additions & 1 deletion lib/class-option-date.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,25 @@ public static function createCalendarScript() {
</script>
<?php
}

/**
* Return time() for specific date string value
*
* @return void
* @since 1.0
*/
public function getDateValueInTime() {
if ( empty( $this->getValue() ) ) {
return '';
}

$pos = strpos($this->getValue(), '-');
if ($pos !== false) {
return strtotime($this->getValue());
}

return $this->getValue();
}


/**
Expand All @@ -164,7 +183,7 @@ public function display() {
$this->getID(),
$placeholder,
$this->getID(),
esc_attr( ($this->getValue() > 0) ? date( $dateFormat, $this->getValue() ) : '' ),
esc_attr( ($this->getValue() > 0) ? date( $dateFormat, $this->getDateValueInTime() ) : '' ),
$this->settings['desc']
);
$this->echoOptionFooter( false );
Expand Down
Loading