ellatrix / wp-front-end-editor

Front-end Editor for WordPress
https://wordpress.org/plugins/wp-front-end-editor/
340 stars 87 forks source link

PHP if.... FEE is being used, #196

Closed christopheran closed 8 years ago

christopheran commented 9 years ago

Ok, with the previous version of FEE I was using I would do this in my single.php:

... if ( isset( $wp_query->query_vars['edit'] ) ) { //if being edited by fee $editOn="editing"; } else { $editOn=""; } ...

and then I would use $editOn in several if statements throughout the page to do a few things such as excluded the adsense ads that I have embedded in the text when it's live, draw some light borders around the editing areas for ease of use, and not load my comments plugin.

With the new version of FEE, there's a # instead of a ? in the url, so the var (now 'fee-edit-link'?) is not passed to php (according to an expert I consulted).

Is there a way I can rewrite my if statment so that $editOn="editing" can be assigned when FEE is being used?

Thanks,

Chris

ellatrix commented 8 years ago

I think you can call has_fee for this. You can also use the CSS classes fee and fee-on on the body. Borders are now added though, and you can't exclude anything in PHP without it being excluded all the time. Why would you like to remove ads and comments? If it's distracting, think about your readers. ;)