• After installing plugin, I can activate and create connections between pages and categories. I see the updates on the front-end when I go to the post category. Some time later (I can’t measure it – next day or several hours) the connections are lost. Returning to the “Category Pages” in the admin, all the connections are reverted to none.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The whole thing resets when you do a quick edit.

    I added this to line 568:
    echo "<input type='hidden' name='p2c_active' value='1'/>";
    and then change the function that starts on line 584

    function page2cat_trigger_save($post_ID){
    	global $wpdb;
    	if ($_POST['p2c_active']):
    		$values = $_POST['p2c_bind'];
    		$via = "DELETE FROM {$wpdb->page2cat} WHERE page_ID = '".$_POST['post_ID']."'";
    		$result = $wpdb->get_results($via);
    		if(count($values) > 0):
    		foreach($values as $key=>$cat){
    			if($_POST['post_ID'] != ""):
    			$sql = "INSERT INTO {$wpdb->page2cat} (rel_ID, page_ID, cat_ID) VALUES ('','".$_POST['post_ID']."','".$cat."')";
    			$result = $wpdb->get_results($sql);
    			endif;
    		}
    		endif;
    	endif;
    }

    All I have added is the first if clause that checks for the new form field value that I added. Since this form element isn’t present when doing a quick edit the function won’t fire and delete all your connections.

    The function will fire normally when doing a real page edit and everything should work fine. I am running the latest wordpress version and everything has worked so far.

    Connections break in 3.0 on regular edits as well know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Category Page] Page connections don’t stay’ is closed to new replies.