Skip to content

Commit ca4e76f

Browse files
authored
Merge pull request #97 from RRZE-Webteam/dev
4.27.21
2 parents aa1bfd3 + 31c1066 commit ca4e76f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

includes/Layout.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,27 @@ public function makeFaqSortable( $wp_query ) {
5656
}
5757
}
5858

59-
// public function saveSort( $post_id ){
6059
public function savePostMeta( $postID ){
6160
if ( ! current_user_can( 'edit_post', $postID ) || ! isset( $_POST['sortfield'] ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ){
6261
return $postID;
6362
}
64-
update_post_meta( $postID, 'source', 'website' );
65-
$lang = substr( get_locale(), 0, 2 );
66-
update_post_meta( $postID, 'lang', $lang );
63+
$source = (empty($_POST['source']) ? 'website' : sanitize_text_field( $_POST['source'] ));
64+
update_post_meta( $postID, 'source', $source);
65+
update_post_meta( $postID, 'lang', substr( get_locale(), 0, 2 ) );
6766
update_post_meta( $postID, 'remoteID', $postID );
68-
$remoteChanged = get_post_timestamp( $postID, 'modified' );
69-
update_post_meta( $postID, 'remoteChanged', $remoteChanged );
67+
update_post_meta( $postID, 'remoteChanged', get_post_timestamp( $postID, 'modified' ) );
7068
update_post_meta( $postID, 'sortfield', sanitize_text_field( $_POST['sortfield'] ) );
7169
}
7270

7371
public function sortboxCallback( $meta_id ) {
74-
$output = '<input type="text" name="sortfield" id="sortfield" class="sortfield" value="'. esc_attr(get_post_meta( $meta_id->ID, 'sortfield', TRUE )) .'">';
72+
$output = '<input type="hidden" name="source" id="source" value="'. esc_attr(get_post_meta( $meta_id->ID, 'source', TRUE )) .'">';
73+
$output .= '<input type="text" name="sortfield" id="sortfield" class="sortfield" value="'. esc_attr(get_post_meta( $meta_id->ID, 'sortfield', TRUE )) .'">';
7574
$output .= '<p class="description">' . __( 'Criterion for sorting the output of the shortcode', 'rrze-faq' ) . '</p>';
7675
echo $output;
7776
}
7877

7978
public function langboxCallback( $meta_id ) {
80-
$output = '<input type="text" name="sortfield" id="sortfield" class="sortfield" value="'. esc_attr(get_post_meta( $meta_id->ID, 'lang', TRUE )) .'">';
79+
$output = '<input type="text" name="lang" id="lang" class="lang" value="'. esc_attr(get_post_meta( $meta_id->ID, 'lang', TRUE )) .'">';
8180
$output .= '<p class="description">' . __( 'Language of this FAQ', 'rrze-faq' ) . '</p>';
8281
echo $output;
8382
}

rrze-faq.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: RRZE FAQ
55
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-faq
66
Description: Plugin, um FAQ zu erstellen, aus dem FAU-Netzwerk zu synchronisieren und mittels Shortcode oder als Block (Gutenberg Editor) einzubinden.
7-
Version: 4.27.20
7+
Version: 4.27.21
88
Author: RRZE Webteam
99
Author URI: https://blogs.fau.de/webworking/
1010
License: GNU General Public License v2

0 commit comments

Comments
 (0)