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

[FEATURE REQUEST] WP CLI Command to regenerate the CSS #2161

Closed
Nikschavan opened this issue Aug 9, 2017 · 8 comments

Comments

Projects
None yet
7 participants
@Nikschavan
Copy link
Contributor

commented Aug 9, 2017

This command can be chained in the automatic site migration tools to clear the cache after the site is migrated to live from staging or vice-versa.

Right now this can be quickly run from WP CLI like this - wp eval "Elementor\Plugin::$instance->posts_css_manager->clear_cache();" Although it would be nice to have this as a dedicated command.

@Nikschavan Nikschavan changed the title WP CLI Command to regenerate the CSS [FEATURE REQUEST] WP CLI Command to regenerate the CSS Aug 9, 2017

@KingYes KingYes self-assigned this Aug 9, 2017

@Nikschavan

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2017

I just added a PR #2177 which adds this command. I will appreciate feedback on a few points -

  1. I have placed the new file in includes\ directory. Is this Ok or needs to be changed?
  2. Right now I am loading the file with require_once only when the constant WP_CLI is defined. should this be loaded with the autoloader?
@julianxhokaxhiu

This comment has been minimized.

Copy link

commented Jan 23, 2018

Please consider this. I would like to have a control on flushing CSS files too.

@Nikschavan

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2018

I have made this as a WP Cli package which you can use in order to get this functionality - https://github.com/Nikschavan/elementor-commands/

@julianxhokaxhiu

This comment has been minimized.

Copy link

commented Jan 23, 2018

Wow, appreciated! Thanks :)

@HW-Siew

This comment has been minimized.

Copy link

commented Mar 3, 2018

Hi, @Nikschavan , I was trying to run wp eval "Elementor\Plugin::$instance->posts_css_manager->clear_cache();". but it show an error 'Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in phar:///usr/local/bin/wp/vendor/wp-cli/eval-command/src/Eval_Command.php(37) : eval()'d code on line 1'.

Any idea what is wrong? Thanks for your advice.

@franzarmas

This comment has been minimized.

Copy link

commented May 22, 2018

@Nikschavan It is possible that the Elementor license can be activated through WP-CLI ?? just as you do with ASTRA ??? .. create a request for it to add it but surely they will delay in considering it .. it would take you a long time to develop it your friend? ...

I would thank you infinitely.

Thank you!

@matipojo matipojo referenced this issue Jun 7, 2018

Merged

Feature/wp cli #4691

@KingYes

This comment has been minimized.

Copy link
Member

commented Jun 7, 2018

Thank @Nikschavan !

@KingYes KingYes closed this Jun 7, 2018

@arielk arielk added this to the 2.1.0 milestone Jun 10, 2018

@ligne13

This comment has been minimized.

Copy link

commented Nov 22, 2018

Hi,
correct me if I'm wrong but this command delete CSS files but do not recreate them for each page. Though the ticket subject was 'WP CLI Command to regenerate the CSS'.

Is there a way via CLI to generate the CSS file of each page ?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.