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
- and
- How do I show data from gravity forms in my template? [closed]
- How to Link External jQuery/Javascript files with WordPress
- Add tags to the section via functions.php
- Why is wp_head() creating a top margin at the top of my theme header?
- How can I remove the site URL from enqueued scripts and styles?
- How to add stylesheets only to pages with specific shortcode?
- force enqueue script to be first in order of prominence
- What does l10n.js do in WordPress 3.1? And how do I remove it?
- Any advantage of using wp_scripts and is_IE when enqueuing scripts
- Remove meta robots tag from wp_head
- Caching and Versioning for rtl.css
- How do I force wp_enqueue_scripts to load at the END of ?
- Two title tags in my header
- Can an action callback prevent the parent from continuing execution?
- wp_head() gives me some weird CSS
- gravity forms : use previous dropdown choice as variable in gform_pre_render? [closed]
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- Removing specific style from wp_head
- Set cookie using GET variable
- Delete the original big size image after upload and leave only 3 images crunched by media gallery
- How to get the Gravityform entry ID from current user’s form submission? [closed]
- Change Page’s Tag Using functions.php File
- Saving images from Gravity Forms repeatable File Upload as post attachments [closed]
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- How to control initial wp_head() output?
- Hook into wp_head(); in a plugin
- How can I reduce the amount of files loaded/included per plugin?
- Function to call the attachment image from post
- when should an action be added to init and when should it be added to wp_head
- Change title in head on Archive page
- Gravity Forms Custom Templates [closed]
- WordPress Uploads Folder can’t be Written to
- Best way to create multi-step form with data saved to user account for later updating?
- How can I get wp_head() as a string instead of echoing it?
- Gravity form to submit to third party application
- Add code into on a per page/post basis
- Get selected values from checkboxes and radio buttons via Gravity Forms gform_after_submission hook [closed]
- Modify page title format (when using title-tag)
- Display custom_background outside wp_head()
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- How to load different css file for different pages
- Putting content into header.php without using wp_head
- Gravity Forms loading jquery
- Redirect to post after submission with Gravity Forms? [closed]
- Get restrict content by submitting Gravity Forms
- Track down where script is being enqueued from
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Change meta tags programatically
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- How to properly insert a stylesheet in wp_head
- Help debugging PHP filter for wordpress [closed]
- append stylesheet via shortcode
- Change dns-prefetch to preconnect with correct protocol
- Remove specific CSS and JS from the head
- Using auth_redirect returns cannot modify header information
- Searching hook to set cookies before and avoid “headers already sent”
- gform_after_submission content appears immediately after , not in post body [closed]
- Change Default wp_mail From, Without Affecting Gravity Forms
- How to load plugin before the wordpress jquery?
- Why does wp_enqueue_script ignore my ‘wp_head’ hook?