MTWK-IDG
Forum Replies Created
-
The following code applies the new content to ALL open graph data. How do I just change the og:description
function replace_meta_description($content,$property='og:description') { $ai_yoast_description = get_post_meta( get_the_ID(),'_yoast_wpseo_metadesc' ); $yoast_description = $ai_yoast_description[0]; $content = $yoast_description; return $content; } add_filter('open_graph_protocol_meta','replace_meta_description');
Forum: Hacks
In reply to: Update a Gravity Form id with Quick Editupdating status of post
Forum: Hacks
In reply to: Update a Gravity Form id with Quick EditThank you. Thank you. Thank you. I didn’t have to pull the if statement. The change in the array made all the difference. You made my month! I’ve been banging my head for weeks on this.
Forum: Hacks
In reply to: Update a Gravity Form id with Quick EditThanks for the response. I will try that.
Forum: Hacks
In reply to: Update a Gravity Form id with Quick EditOkay. Still wrestling with this code. I’ve tested this code with serialized and non-serialized post meta.
This code works perfectly fine with non-serialized meta. I go into Quick Edit, update the field and voila – the field is updated and displays correctly in the Admin List. So far so good.
// BEGIN SAVE THE QUICK EDIT DATA +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ add_action( 'save_post','rachel_carden_save_post', 10, 2 ); function rachel_carden_save_post( $post_id, $post ) { // don't save for autosave if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id; // dont save for revisions if ( isset( $post->post_type ) && $post->post_type == 'revision' ) return $post_id; switch( $post->post_type ) { case 'pattern': // release date // Because this action is run in several places, checking for the array key keeps WordPress from editing // data that wasn't in the form, i.e. if you had this post meta on your "Quick Edit" but didn't have it // on the "Edit Post" screen. if ( array_key_exists( 'pattern_company', $_POST ) ) update_post_meta( $post_id, 'wpcf-own-pattern', $_POST[ 'pattern_company' ] ); break; } } // END SAVE THE QUICK EDIT DATA +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' Now I take that same EXACT code but attempt to use it with serialized data. I go into quick edit, update the item and voila - it now shows nothing in the targeted information - in this case, the id of the gravity form is now blank. '// BEGIN SAVE THE QUICK EDIT DATA +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ add_action( 'save_post','rachel_carden_save_post', 10, 2 ); function rachel_carden_save_post( $post_id, $post ) { // don't save for autosave if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id; // dont save for revisions if ( isset( $post->post_type ) && $post->post_type == 'revision' ) return $post_id; switch( $post->post_type ) { case 'product': // release date // Because this action is run in several places, checking for the array key keeps WordPress from editing // data that wasn't in the form, i.e. if you had this post meta on your "Quick Edit" but didn't have it // on the "Edit Post" screen. if ( array_key_exists( 'ai_gravityforms', $_POST ) ) $gravity_form_data = get_post_meta( $post_id,'_gravity_form_data');// grab the current serialized array in the database $gravity_form_data[0]['id'] = '10'; // replace the id in the serialized array with some test data //$gravity_form_data[0]['id'] = '$_POST[ 'ai_gravityforms' ]; this is what I really want to grab update_post_meta( $post_id, '_gravity_form_data', $gravity_form_data ); break; } } // END SAVE THE QUICK EDIT DATA +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When I test the following in the footer of page:
$gravity_form_data = get_post_meta( get_the_ID(),’_gravity_form_data’);
I can do a var_dump and see all the post meta for the particular product page that I’m on.
I can also replace the id by
$gravity_form_data[0][‘id’] = ’10’;
This all works but not inside the above function.So the bottom line: How do I update serialized data when being processed via Quick Edit.
Forum: Hacks
In reply to: Update a Gravity Form id with Quick EditTHey say it’s beyond their support.
Forum: Fixing WordPress
In reply to: Build the args parameter dynamically when don't how/which argsIf they pick from more than one, then the post(s) would have to be in all three terms.
Forum: Fixing WordPress
In reply to: Loop returning 1 or 2 post results when asking for 3Site being used on:
linkForum: Fixing WordPress
In reply to: Add external style sheet from child theme to home page onlyThat works except that is_home() didn’t work. I’m using a static page for a home page. home is being added as the body class. But is_home() is not recognizing this as home page.
Got around it by pointing to the page id.Thanks for your help.
Forum: Plugins
In reply to: [Manage Upload Types] "not found" error for certain file typeI’m having the same problem. Did you ever resolve this? I’m being told by hosting company that it’s a windows server issue.
Forum: Themes and Templates
In reply to: How do I change the word Start to Home in the menu“when you add a new page, no it does not automatically add it to the menu”
That’s the problem. I need it to automatically add the page as I’m not going to be maintaining this site. The person who will needs to be able to add pages on the fly without worrying about having to update the menu also. Should I just use another theme?Forum: Themes and Templates
In reply to: How do I change the word Start to Home in the menuI’ve never done custom menu’s before. Will it automatically add to the custom menu when I add a page?
Forum: Themes and Templates
In reply to: How do I change the word Start to Home in the menu“have you set up your menu? Appearance>menus”
Sorry I don’t understand the question. I’m just letting wordpress create the menu from the pages being created. Not sure why I would have to create a menu. I’ve never had to create a menu before. I’m not creating a custom menu here. This is just the basic navigation driven by wordpress. For some reason, it’s not taking the page name like it usually does and using it in the menu. I’ve never had this happen before. All my other pages are working fine. It’s just the home page that’s not cooperating. It’s named Home not Start but the menu doesn’t recognize that.