Skip to content

Commit

Permalink
v0.22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GiorgioKM committed Jan 12, 2018
1 parent af71a91 commit d8f0f48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

#### v0.22.2 - 12 Gennaio 2018
* Aggiunto argomento 'suppress_filters => true' quando viene richiamato il metodo 'get_posts'

#### v0.22.1 - 11 Gennaio 2018
* Sistemato un problema con il metodo 'returnAllMeta()'

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MetaBoxesHandler
================

![Build Status](https://img.shields.io/badge/build-v0.22.1-green.svg?style=flat)
![Build Status](https://img.shields.io/badge/build-v0.22.2-green.svg?style=flat)

È un utility per Wordpress per la gestione automatizzata di metabox da utilizzare con un custom post type, sia lato backend che frontend.

Expand All @@ -23,15 +23,18 @@ Crediti
|Tipo|Descrizione|
|:---|---:|
|@autore|Giorgio Suadoni|
|@versione|0.22.1|
|@data ultimo aggiornamento|11 Gennaio 2018|
|@versione|0.22.2|
|@data ultimo aggiornamento|12 Gennaio 2018|
|@data prima versione|20 Maggio 2017|



Changelog
---------

#### v0.22.2 - 12 Gennaio 2018
* Aggiunto argomento 'suppress_filters => true' quando viene richiamato il metodo 'get_posts'

#### v0.22.1 - 11 Gennaio 2018
* Sistemato un problema con il metodo 'returnAllMeta()'

Expand Down
10 changes: 2 additions & 8 deletions dist/includes/BaseMBH.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ public function mbhSaveActionWP($post_id) {
}
}


/*################################################################################*/
/*## METODI PROTETTI ##*/
/*################################################################################*/
Expand Down Expand Up @@ -354,7 +353,7 @@ protected function _WPaddActionSave() {
* @ritorno array
*/
protected function _getPostMetaAsArrays($includeAllPosts = false) {
global $post, $query;
global $post;

$this->_generalCheck();

Expand All @@ -379,18 +378,13 @@ protected function _getPostMetaAsArrays($includeAllPosts = false) {
};

if (!$post || get_post_type($post) != $this->postType || $includeAllPosts) {
add_action('pre_get_posts', function ($query) {
$query->set('posts_per_page', -1);

return $query;
}, 0);

$args = array(
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => $this->postType,
'post_status' => 'publish',
'suppress_filters' => true,
);

$getPosts = get_posts($args);
Expand Down

0 comments on commit d8f0f48

Please sign in to comment.