Skip to content

Commit

Permalink
bugfix use
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome committed Dec 22, 2018
1 parent e9b8be7 commit eb8a810
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions doc/wordpress.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ remove_submenu_page:
# subdomain_install: true
# shared_media: true
# multilangue: true
# multidomain: true
# clone_post: true
# default_locale: 'fr'

#define:
# disallow_file_edit: false
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function orderItems($menu_items)
{
if( $item->menu_item_parent != 0 )
{
$ordered_menu[$item->menu_item_parent]['children'][] = $item;
$ordered_menu[$item->menu_item_parent]->children[] = $item;
unset($ordered_menu[$item->ID]);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Factory/PostFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ public static function create($id=null, $post_type = false){
}
if( is_object($id) ) {

if( $post instanceof \WP_Post ) {
if( $id instanceof \WP_Post ) {

$id = $id->ID;
$post_type = $id->post_type;
$post = $id;
$id = $post->ID;
$post_type = $post->post_type;
}
else{
return new \WP_Error('post_factory_invalid_post_object', 'The object is not an instance of WP_Post');
Expand Down
7 changes: 4 additions & 3 deletions src/Factory/TaxonomyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ public static function create($id=null, $taxonomy_name = false){
}
if( is_object($id) ) {

if( $post instanceof \WP_Term ) {
if( $id instanceof \WP_Term ) {

$id = $id->term_id;
$taxonomy_name = $id->taxonomy;
$term = $id;
$id = $term->term_id;
$taxonomy_name = $term->taxonomy;
}
else{
return new \WP_Error('taxonomy_factory_invalid_term_object', 'The object is not an instance of WP_Term');
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/permastructs.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function addRoute( $name, $struct, $requirements=[], $paginate=false )

$collection = new RouteCollection();

if( $_config->get('multisite.multilangue') && !$_config->get('multisite.subdomain_install') )
if( $_config->get('multisite') && !$_config->get('multisite.multilangue') && !$_config->get('multisite.subdomain_install') )
{
foreach (get_sites() as $site)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Traits/ContextTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

namespace Metabolism\WordpressBundle\Traits;

use Metabolism\WordpressBundle\Entity\Comment;
use Metabolism\WordpressBundle\Factory\PostFactory;
use Metabolism\WordpressBundle\Factory\TaxonomyFactory;
use Metabolism\WordpressBundle\Helper\ACF;
use Metabolism\WordpressBundle\Factory\PostFactory,
Metabolism\WordpressBundle\Factory\TaxonomyFactory;
use Metabolism\WordpressBundle\Helper\ACF,
Metabolism\WordpressBundle\Helper\Query;
use Metabolism\WordpressBundle\Plugin\TermsPlugin;
use Metabolism\WordpressBundle\Provider\WooCommerceProvider;

use Metabolism\WordpressBundle\Entity\Post,
Metabolism\WordpressBundle\Entity\Query,
Metabolism\WordpressBundle\Entity\Term,
Metabolism\WordpressBundle\Entity\Menu;
Metabolism\WordpressBundle\Entity\Menu,
Metabolism\WordpressBundle\Entity\Comment;


/**
Expand Down

0 comments on commit eb8a810

Please sign in to comment.