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

Added WordPress post formatting #2 #292

Open
wants to merge 10 commits into
base: 2.7
Choose a base branch
from
Open

Added WordPress post formatting #2 #292

wants to merge 10 commits into from

Conversation

mforcer
Copy link

@mforcer mforcer commented Jul 27, 2017

I have updated my pull request.

(I'm not sure why my push didn't update original pull request #254 - Maybe because I changed from master to dev?)

Let me know your thoughts.

If all is good we can close the old pull request.

Thanks

@jgrossi
Copy link
Member

jgrossi commented Jul 31, 2017

Hi @goodbytes-gb thanks for the hard work. I'm going to take a look on this and give you a feedback. Thanks!

@omzy
Copy link

omzy commented Aug 11, 2017

Is this good to go? We definitely need it to automatically insert p tags when outputting content from posts table!

@jgrossi
Copy link
Member

jgrossi commented Aug 30, 2017

@goodbytes-gb can you fix this last conflict, please?

@Dartui
Copy link
Contributor

Dartui commented Aug 31, 2017

@goodbytes-gb When WordPress is formatting code, before or after parsing shortcodes?

@mforcer
Copy link
Author

mforcer commented Aug 31, 2017

@Dartui Currently it grabs post content with already parsed shortcodes, then formats the output. (i.e. before)

@Dartui
Copy link
Contributor

Dartui commented Aug 31, 2017

@goodbytes-gb This is a list of all default filters for the_content:

  • add_filter( 'the_content', 'wptexturize' );
  • add_filter( 'the_content', 'convert_smilies', 20 );
  • add_filter( 'the_content', 'wpautop' );
  • add_filter( 'the_content', 'shortcode_unautop' );
  • add_filter( 'the_content', 'prepend_attachment' );
  • add_filter( 'the_content', 'wp_make_content_images_responsive' );

After wpautop there is shortcode_unautop which I guess is missing in this PR and may cause some unexpected behaviour

What is more, please look at this:

// Shortcodes
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop()

@mforcer
Copy link
Author

mforcer commented Aug 31, 2017

@Dartui Thanks for the info, will look into it now.

@mforcer
Copy link
Author

mforcer commented Sep 1, 2017

@Dartui It appears I confused myself... On closer inspection, it looks like running 'shortcode_unautop' is not necessary as it specifically refers to shortcodes added from the WP side, which Corcel would never be able to process as it does not have access to the shortcode callbacks.

Corcel already handles processing of shortcodes that have been added from Corcels implementation.

I have slightly refactored and can now confirm shortcodes are processed after the post content is formatted.

Hope this makes sense.

@matthewscalf
Copy link

Will this be included in a release soon?

@jgrossi
Copy link
Member

jgrossi commented Sep 12, 2017

Once now we're working with different Laravel versions (L5.5 for Corcel 2.5, for example), I'm gonna add this to the 2.5 branch only. If anyone needs this to another Laravel version just send a new PR to that branch (for example for Laravel 5.4, branch 2.4). Ok?

@jgrossi jgrossi changed the base branch from dev to 2.5 September 12, 2017 11:47
@dominicbouffard
Copy link

Hello guys,

Any news on that PR? That would definitely help me, I need paragraphs!! 😄

Thanks

@jgrossi
Copy link
Member

jgrossi commented Jan 19, 2018

Hey, yep this PR's gonna be merged soon. I have been a little busy theses last months but this is gonna be merged shortly. Thanks for the patience. 😉

@DivineOmega
Copy link

This would be really useful for a project I'm working on. Can it be merged now, or is there more work needed?

@iteearmah
Copy link

+1

@rjsworking
Copy link

+1

@pechanxur
Copy link

Can it be merged now, or is there more work needed?

@stanwarri
Copy link

Will this support the new Wordpress editor - https://wordpress.org/gutenberg/ ?

@mforcer
Copy link
Author

mforcer commented Aug 27, 2018

@stanwarri Probably not, it will need updating or may not be needed at all. Have not tested it yet.

@jgrossi jgrossi changed the base branch from 2.5 to 2.6 August 31, 2018 12:47
@jgrossi
Copy link
Member

jgrossi commented Aug 31, 2018

@gdbytes gonna merge this PR ASAP. can you just merge the current 2.6 branch into yours? I don't have enough privileges to do that. then all tests are gonna pass I guess. thanks 😎

@mforcer
Copy link
Author

mforcer commented Sep 13, 2018

@jgrossi can you advise how to achieve this? Thanks

@jgrossi
Copy link
Member

jgrossi commented Sep 14, 2018

@gdbytes hey thanks for answering. the point is we have changed some code during the time on 2.6 and now also 2.7. this is failing this PR, so it's important to merge the 2.6 branch into it. something like this:

  • update your local 2.6 branch with the last updates in the main Corcel repo;
  • merge it to the current branch you are (your PR, it's dev I think): git merge 2.6
  • push the changes to your PR

if you need some help you can give me push permission to your dev branch, or ping me for a quick call or something like that.

thanks 👏👍

@mforcer
Copy link
Author

mforcer commented Sep 20, 2018

@jgrossi thanks I am struggling with this, unfortunately, where is best to catch you? Skype?

@jgrossi
Copy link
Member

jgrossi commented Sep 20, 2018

hey @gdbytes feel free to ping me on skype: juninhogr or discord: jgrossi#7360. I'm online usually in the morning.

@mforcer
Copy link
Author

mforcer commented Oct 29, 2018

@jgrossi I've contacted you on discord (lunah#1208) ... Apologies for the delay, I've been mega busy.

@jgrossi jgrossi changed the base branch from 2.6 to 2.7 December 3, 2018 17:43
@jgrossi jgrossi added the wip label Dec 3, 2018
@PayteR
Copy link

PayteR commented Apr 14, 2019

This is still not merged due to 4 issues to fix?

@mforcer
Copy link
Author

mforcer commented Apr 15, 2019

I believe @jgrossi was fixing the issues but nothing as of yet.

I'm not sure how viable this is now with Gutenberg, it hasn't been tested.

@PayteR
Copy link

PayteR commented Apr 15, 2019

Gutenberg block will not be generated by this, but at least it will be compatible with standard post_content filtered output. IMHO it should be merged and later it could be possible to implement Gutenberg blocks into this.

@Dartui
Copy link
Contributor

Dartui commented Apr 15, 2019

@PayteR This is how Gutenberg post looks like: https://github.com/WordPress/gutenberg/blob/master/post-content.php. There is no need to additionally parse it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet