Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new Goal Complete WYSIWYG doesn't currently render oEmbeds #1545

Closed
mathetos opened this issue Feb 24, 2017 · 4 comments
Closed

The new Goal Complete WYSIWYG doesn't currently render oEmbeds #1545

mathetos opened this issue Feb 24, 2017 · 4 comments
Assignees
Milestone

Comments

@mathetos
Copy link
Member

@mathetos commented on Wed Feb 22 2017

This might be a Give CORE issue, but if you add a YouTube video into the "Duration Ended Message" WYSIWYG field, it will render as an oEmbed in the backend, but not in the front-end.

@mathetos
Copy link
Member Author

Steps to Reproduce:

  1. Test with our new Give Form Countdown Addon
  2. In the "Duration Achieved Message" field, enter a Youtube link
  3. Set the form to expire in the past
  4. Save and view the form and instead of a rendered youtube video, you'll just see the youtube link output onto the page

In testing this I believe this has to do with how our WYSIWYG field is saving the data.

@ravinderk
Copy link
Collaborator

ravinderk commented Feb 24, 2017

@mathetos oEmbeds is not working in goal message because it should be a plain text in terms of current core goal message design. Since we updated goal message field to WYSIWYG, so core goal message design will break if anybody uses anything other then text.

For now you can use give_goal_closed_output filter to render oEmbeds.

function give_custom_goal_message( $styled_goal_message, $form_id ) {
	$goal_message = apply_filters(
		'the_content',
		get_post_meta( $form_id, '_give_form_goal_achieved_message', true )
	);

	return $goal_message;
}
add_filter( 'give_goal_closed_output', 'give_custom_goal_message', 10, 2 );

For Ref: https://github.com/WordImpress/Give/blob/release/1.8.3/includes/admin/forms/class-metabox-form-data.php#L397#L404

@DevinWalker what do you think?

@DevinWalker DevinWalker self-assigned this Feb 24, 2017
@DevinWalker DevinWalker added this to the 1.8.3 milestone Feb 24, 2017
@mathetos
Copy link
Member Author

@ravinderk Thanks for the clarification. I do think it's important that a WYSIWYG field outputs exactly as it does in the admin -- currently the oEmbed renders in the Admin. That is the expectation users will have as well.

@DevinWalker
Copy link
Member

@mathetos me too, I have a fix coming for that in 2 min.

DevinWalker pushed a commit that referenced this issue Feb 24, 2017
DevinWalker pushed a commit that referenced this issue Feb 24, 2017
Use `the_content` to output Goal complete message #1545
@DevinWalker DevinWalker changed the title WYSIWYG doesn't currenlty render oEmbeds The new Goal Complete WYSIWYG doesn't currently render oEmbeds Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants