Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ncwebdev

    (@ncwebdev)

    Hi jojoee,

    it’s me again. 🙂
    Have checked the modified plugin and found one minor thing which maybe could be improved: When the moved page have children itself, they are not moved with their parents but were moved to the top level.

    Before:

    parent 1
    > child 1-1
      > child 1-1-1
    parent 2

    When I move "child 1-1" to "parent 2" it will become

    parent 1
    parent 2
    > child 1-1
    child 1-1-1

    Maybe you can improve your plugin that it can also handle that sub-pages?

    Kind Regards… 🙂

    Thread Starter ncwebdev

    (@ncwebdev)

    Yeah!!!!!!!

    I found the bug in your plug-in and now I know, why you can’t replicate my problem. 🙂
    Your plug-in is working fine when you uses the default table-prefix (“wp_”), but as I have multiple WP-installations in my database I uses a custom table-prefix for each installation.
    In your function remove_page_from_menu you named the table wp_term_relationships straight.

    I have updated your function like this and now it seems like it works.

    function remove_page_from_menu( $object_id ) {
    	global $wpdb, $table_prefix;
    	$query = sprintf( 'DELETE FROM '.$table_prefix.'term_relationships WHERE object_id = %d', $object_id ); 
    
    	$wpdb->get_results( $query, OBJECT );
    }

    I will make some more tests and report later … 🙂

    Thread Starter ncwebdev

    (@ncwebdev)

    Hi jojoee

    Thx for your support. I have put a dump on my dropbox for you:

    https://www.dropbox.com/ (Please drop me a note when you have downloaded it.)

    Kind Regards…

    Thread Starter ncwebdev

    (@ncwebdev)

    Hi jojoee,

    sorry for the late reply but I have been on easter vacation. 🙂

    I tried it exactly as you mentioned it above but still the same problem. When I moved the Baby-dog-1 from dog to cat , I become a double entry, one unter dog and one under cat.

    That is more than curios … :-/

    Thread Starter ncwebdev

    (@ncwebdev)

    Hi!

    just tested it with a clean install (4.4.2) and a standard theme (Twenty Sixteen), still the same problem as descripted above.

    Cheers.

    Thread Starter ncwebdev

    (@ncwebdev)

    Hi jojoee,

    I’m running the latest WP-Version (4.4.2) with the BeTheme theme. I don’t think that their is a conflict with an other plugin, because I have deactivated the most of them, but I will test it on a clean install later, too.

    Kind Regards…

    Thread Starter ncwebdev

    (@ncwebdev)

    I created a new (sub)page => everything works fine.

    Menu-Structure:

    Parent 1
    - Child 1-1
    - Child 1-2
    - Child 1-3 (new)
    Parent 2
    - Child 2-1
    - Child 2-2

    Then I move the subpage to an other parent page by changing the page attribte ‘parent’ like you provide on your [screenshot 2], the page is sucessfully moved to its new parent and is even shown correctly in the new position in the menu, BUT it remains ADDITIONAL on the old position in the menu.

    Menu-Structure after moving:

    Parent 1
    - Child 1-1
    - Child 1-2
    - Child 1-3 (old position <= wrong!)
    Parent 2
    - Child 2-1
    - Child 2-2
    - Child 1-3 (moved <= correct!)

    I hope you can reproduce my steps now more clearly. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)