Giter Site home page Giter Site logo

Comments (7)

GerritKuilder avatar GerritKuilder commented on July 28, 2024

I just confirmed that the edit button shows up on all articles if an author is logged in, when in the admin panel a logged in author can only edit their own articles. I consider this pretty major

from wordpress-bootstrap.

mindctrl avatar mindctrl commented on July 28, 2024

I think this commit causes the issue:
acc7ce0#single.php

edit_post_link handles displaying the Edit link to authorized users automatically.

from wordpress-bootstrap.

GerritKuilder avatar GerritKuilder commented on July 28, 2024

In order to get the nice button the <a tag needs the label, so an override for the eodt_pos_link should be made. Starangely enough the button shows only up on Chrome/linux, I did not see it on my windows machine.

from wordpress-bootstrap.

mindctrl avatar mindctrl commented on July 28, 2024

You can get the custom class on edit_post_link by doing this in functions.php

/* Add class to edit button */
function my_custom_edit_post_link($output) {
 $output = str_replace('class="post-edit-link"', 'class="post-edit-link btn btn-success"', $output);
 return $output;
}
add_filter('edit_post_link', 'my_custom_edit_post_link');

from wordpress-bootstrap.

GerritKuilder avatar GerritKuilder commented on July 28, 2024

To be more precise (to get the hover effect)

/* Add class to edit button */
function gk_edit_post_link($output) {
 $output = str_replace('class="post-edit-link"', 'class="post-edit-link btn btn-success" style="display: none;"', $output);
 return $output;
}
add_filter('edit_post_link','gk_edit_post_link');

from wordpress-bootstrap.

mindctrl avatar mindctrl commented on July 28, 2024

My hover effect works without that extra style. If by hover effect you mean the subtle color change? In fact, your code makes my button not show at all.

from wordpress-bootstrap.

GerritKuilder avatar GerritKuilder commented on July 28, 2024

I'm sorry you are right. no "display:none" needed...
Oops I spoke too soon, with display:none it does Sweet FA, without it the button always shows. Might be a plugin I use (code used on devel.kuilder.net/bootstrap in the first child theme. (and I am logged in as admin.) I had it working for a bit....

And originally the button would only who when you hovered over p-arts of the article.

from wordpress-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.