Is there any way to recover deleted menu from database sql backup

I’ve resolved the problem with explained here : http://marketermatt.com/export-navigation-menus/ But i would like to warn the people that will try this solution, you have to have a database backup of WordPress system which has Menu that you would like to revert BackUp your WP database to your PC (bacause, you will use this for reverting … Read more

How to Determine a Post’s Last Edited Date?

If I got your question right, and you want posts created/modified between 3 years ago and today, try this query: SELECT p.ID, concat(‘http://www.toronto.com/restaurants/’, p.post_name) FROM wp_posts p WHERE p.post_type=”restaurant” AND p.post_status=”publish” AND p.post_modified > DATE_SUB(now(), INTERVAL 36 MONTH); Because your DATE_SUB returns something like this: NOW – 3 years, so, it’s something along the lines … Read more

Where should I put this custom data?

Supposing that each food item is treated as a post (perhaps even a custom post type), and the parameters (name/calories/etc.) are attributes of this post, you would do well to treat them as post meta fields. Various means exist to grant end-users the ability to maintain custom fields; my preferred option is Developer’s Custom Fields, … Read more

Function to get the name in database table from the comma separated string

Not tested but this should work: add_action(‘manage_pages_custom_column’, ‘display_page_custom_cols’, 10, 2); function display_page_custom_cols($col_name, $post_id) { global $wpdb; $user_group = $wpdb->get_results(“SELECT * From custom_user_group”,OBJECT_K); if (‘user_group’ == $col_name) { $pages = explode(‘,’,get_post($post_id)); $output = array(); foreach ($pages as $page ) { $output[] = $user_group[$page]->GroupName; } echo implode(‘,’,$output); } }