diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2017-02-05 13:56:01 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2017-02-05 13:56:01 -0500 |
commit | ff7c8b8754c21c3ec030948d0a30b0ad2cdc20aa (patch) | |
tree | c4a1ffb39043a38a3e3af1e0f27746820c659da0 /plugins/wordpress-mobile-pack/export | |
parent | updating jetpack plugin (diff) | |
download | blogs-gentoo-ff7c8b8754c21c3ec030948d0a30b0ad2cdc20aa.tar.gz blogs-gentoo-ff7c8b8754c21c3ec030948d0a30b0ad2cdc20aa.tar.bz2 blogs-gentoo-ff7c8b8754c21c3ec030948d0a30b0ad2cdc20aa.zip |
Update plugin wordpress-mobile-pack 2.2.8
Diffstat (limited to 'plugins/wordpress-mobile-pack/export')
-rwxr-xr-x | plugins/wordpress-mobile-pack/export/class-export.php | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/plugins/wordpress-mobile-pack/export/class-export.php b/plugins/wordpress-mobile-pack/export/class-export.php index 6005059b..3e2caa79 100755 --- a/plugins/wordpress-mobile-pack/export/class-export.php +++ b/plugins/wordpress-mobile-pack/export/class-export.php @@ -77,11 +77,11 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { if ($full_url && is_array($image_metadata) && !empty($image_metadata)) { if (isset($image_metadata['sizes']) && is_array($image_metadata['sizes'])){ - + $thumbnail = isset($image_metadata['sizes']['medium_large']) ? $image_metadata['sizes']['medium_large'] : $image_metadata['sizes']['large']; - + if (isset($thumbnail['file']) && isset($thumbnail['width']) && isset($thumbnail['height'])) { - + return array( "src" => str_replace(basename($full_url), $thumbnail['file'], $full_url), "width" => $thumbnail['width'], @@ -1500,8 +1500,6 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { * - content = 'exportpage' * - pageId = The page's id * - * @todo (Improvement) Don't export page if its parent is hidden - * */ public function export_page() { @@ -1519,10 +1517,21 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { if ($post != null && $post->post_type == 'page' && $post->post_password == '' && $post->post_status == 'publish' && strip_tags(trim($post->post_title)) != '') { // check if page is visible - $is_visible = false; + $is_visible = true; + + if (in_array($post->ID, $this->inactive_pages)){ + $is_visible = false; + } + + // check if the page's ancestors are all visible + if ($is_visible) { + + $ancestors = get_post_ancestors($post); - if (!in_array($post->ID, $this->inactive_pages)) - $is_visible = true; + if (count(array_intersect($ancestors, $this->inactive_pages)) > 0){ + $is_visible = false; + } + } if ($is_visible) { |