Well You can also try by adding action inside.
function after_submission( $entry, $form ) {
$name = $entry[2];
$item = $entry[5];
insert_og_in_head( $name, $item );
add_action( "wp_head", "insert_og_in_head" );
}
add_action( "gform_after_submission", "after_submission", 10, 2 );
function insert_og_in_head( $name = NULL, $item = NULL) {
global $post;
if ( !is_page( 6 ) ) //if it is not a post or a page
return;
echo '<meta property="og:title" content="' . $name . ' lorem opossum dolor"/>';
echo '<meta property="og:description" content="' . $item . ' lorem." />';
echo '<meta property="og:type" content="website"/>';
}
Related Posts:
- WordPress Code Flow
- How can i get the name parameter defined in get_header?
- Is there a way to read or list wp_head() contents?
- Multi-page posts do not get indexed by Google due to canonical URLs
- Remove rel=’dns-prefetch’ href=’//maps.google.com’ from wp-head
- How to remove pingback from head?
- wp_head() outputs in body
- Change dns-prefetch to preconnect for external enqueued resources
- How to remove unnecessary elements in the HTML document head
- wp_head() not including styles and javascripts after a template redirect
- Removing Visual Composer head meta (works alone but not with IF)
- removing wordpress generated code from the head section?
- Change default s.w.org dns-prefetch resource hint value
- using wp_head in body tag for css style
- Use wp-load() and wp_head() to render a page’s header outside of WordPress
- Set title of page using custom page template
- How do I add a logo to my website?
- Set up description meta automatically
- How to find which plugin is outputting Open Graph tags to
- Why would wp_head() cause the menus to break?
- wp_head function outputs after
- Remove_action inside a function
- Does adding a callback like this to wp_head allows you to add additional content?
- How can i remove JUST Description tag from wp_head() function?
- Custom page with WP Header showing Page not found title
- Getting the contents of wp_head while in admin?
- Wp_head () affecting my images layout
- How to add meta tags inside single image page?
- How to store wordpress functions (wp_head(),wp_footer()) in a javascript variable?
- “Warning: count()” printing in Page templates
- How can I edit a meta description
- Hide page name in wordpress page title
- Is it possible to add post specific info in head of worpress post for OG use
- Unable to apply selective loading
- why php tag is not working if i store and show it in wp_head?
- output specific location in the header
- Data validation for inline javascript
- Why is wp_head() creating a top margin at the top of my theme header?
- What does l10n.js do in WordPress 3.1? And how do I remove it?
- Can an action callback prevent the parent from continuing execution?
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- Set cookie using GET variable
- Best way to create multi-step form with data saved to user account for later updating?
- Gravity Forms loading jquery
- Redirect to post after submission with Gravity Forms? [closed]
- Change Default wp_mail From, Without Affecting Gravity Forms
- Manipulating wp_head content
- Gravity Forms Submit form as another user
- Disable wordpress from including jQuery in the head section
- wp_head() not inserting the default stylesheet style.css
- add_action and wp_head not display content in head section
- Gravity Forms: Create fields programmatically
- Trying to inject twitter metadata into using wp_head action in functions.php – get_the_excerpt() returns null
- Gravity Forms field entries into wp_query loop [closed]
- Remove meta description on certain pages
- CSS from textarea in options page to frontend what to do
- Simple Online Payment for Event Registration [closed]
- Why does using conditional logic in gravity forms break the form when placed using php
- Add sequential number to a Gravityforms form
- Gravity Forms closes my popup on Validation Error [closed]
- Adding auto-complete to custom gravity field not working
- wp_enqueue_script registers script but does not create html tag
- How to modify default controls in WordPress theme customizer
- How to replace a function using a child theme?
- Gravity Forms Upload each entry to Unique Folders
- Can’t find where to modify attrbitutes
- Auto Generated HTML source code formatting
- Value of Query string [closed]
- Gravity Forms non-empty Total field values not submitted [closed]
- wp_enqueue_style on template_redirect level?
- Remove CSS & JS from
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- How to add external remote JS source to Gravity Forms?
- Function to echo (or display?) wordpress tags in the head section
- gform_after_submission not working as expected [closed]
- Gravity Forms data to SOAP Service says Could not connect to host
- gravityform – retrieve multiple check answers “keys” instead of “values”
- Remove an action created by a Gravity Forms add-on
- Hide author info in single posts by certain users
- Am i doing something wrong by getting plugins from github repos?
- Problem with Gravity Forms – multistep form
- Add function to head “no product found”
- Gravity Forms and regex – Doesn’t seem to validate
- Foreach loop through Gravity Forms entries
- Run htmlentities() on all submitted values through gravity forms
- Configuring default woo commerce login with modal popup
- Gravit Forms Notification send after 3rd party API response
- How do I add Facebook OpenGraph meta tags for attachments in the header for a custom theme?
- Background of default template showing instead of the background of custom page template
- Gravity Forms ExactTarget Add-on Plugin: Nothing happens after step 2 when creating a new feed [closed]
- I add some js files from a plugin to a specific location
- How to output wp_enqueue_style() in HTML head instead of footer
- Prevent threading in emails from gravity forms [closed]
- Save post to category with gravity forms (post_data) [closed]
- new to javascript – using in instead of functions.php, not loading correctly
- Head Code for Custom Taxonomy
- How to modify submit button on GravityForms
- Dynamic price for payment button
- How to overwrite image if it already exists – WordPress, Gravity form
- How to modify default tags in wp_head()