Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to add a full edit button to the Front-end Editor plugin.

It's currently like this:

[EDIT] Text text text

I would like to make it like:

[EDIT] Text text text (enables front-end editor)

[FULL EDIT] Text Text Text (goes to the back-end editor)

I think this is the current code for the [EDIT] button:

wp-content/plugins/front-end-editor/build/editor.min.js:

base.prototype.pre_edit_button = function() {
      var _this = this;
      return jQuery('<button>', {
        'class': 'fee-hover-edit',
        'html': FrontEndEditor.data.edit_text,
        'click': function(ev) {
          _this.last_mouse_pos = ev.pageY;
          return _this.start_editing();
        }
      });
share|improve this question
    
What doesn't work? The plugin works ok? Do you mean: edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' );? –  brasofilo Feb 15 '13 at 19:01
    
Take a look :) oi45.tinypic.com/jkf221.jpg –  Lucas B Feb 15 '13 at 19:28
    
Although the formatting of your Question could be improved, I got the idea from the description. What about my questions in the first comment? You seem to be clearly needing edit_post_link... –  brasofilo Feb 15 '13 at 20:00
    
Does this works for pages, instead of posts? How could I add something like this in that jQuery script? I sux at programming :s –  Lucas B Feb 15 '13 at 20:14
    
That's not jQuery, it's PHP and goes within the theme template files. Please, join me in this chat room, eu acho que você precisa de um par de conselhos. –  brasofilo Feb 15 '13 at 20:23

1 Answer 1

I assume the plugin is a separate thing and does its work by itself.

What you need is to include in your theme template files the default Edit button.

First off, you need a good code editor. Notepad++, Sublime Text, NetBeans, to cite a few.

Check one of the default WordPress themes, TwentyTen, TwentyEleven or TwentyTwelve. You'll see this: <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>. This is the default Edit button that you are searching for. Swap to this theme and try to tweak it until you get the idea.

Probably, you'll need some CSS to position it near the plugin's button and to make it visually similar.

Update
Just found this excellent Answer by @MikeSchinkel:
Recommended Books on WordPress for Management and non-Developers?.

share|improve this answer
    
:) I use Notepad++ for html, CSS and SQL files, and NetBeans for PHP, Javascript and pretty much everything else<br/> \n I know very few about programming, but I've done some amazing things in my project so far, I'm very familiar with wordpress by now... The problem with this script is that the "Edit" button from the plugin doesn't have a static position. It goes up-and-down accompaining the mouse movement, when you hover the content... Meh... i don't know, I think it's simply too hard to do it :s Maybe I should skip this functionality... –  Lucas B Feb 15 '13 at 21:05
    
Maybe it's easier to create a button to redirect to the "Page Edit" in back-end? With no specific page id, just like: wp-admin/edit.php?post_type=page –  Lucas B Feb 15 '13 at 21:08
    
Well, then you are not so n00b ツ Maybe you can put the PHP default link in a not-fancy fashion, a subtle text like Edit in backend... –  brasofilo Feb 15 '13 at 21:14
    
Yeah I think I'll do that in last case, but it would be much much better if we could embed it into the javascript ._. –  Lucas B Feb 15 '13 at 21:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.