WordPress.org

Ready to get started?Download WordPress

Forums

wp-admin style css edits - child and or plugin (4 posts)

  1. jimii
    Member
    Posted 7 months ago #

    I am trying to style a wp-admin.css element and have attempted to do it as a child theme and as part of a small function plugin without success. The purpose is to style out the .media-menu to display: none

    Researching this it seemed the plugin route was the best to go (I have function edits in a twenty ten child and thought this would allow me to aggregate it all together into the single file. I thought I had the initial part working but then it wasn't; throwing errors so I backed it out and back in. No more errors but it doesn't function...
    The plugin is coded with:`function my_afs_theme_style() {
    wp_enqueue_style('my-afs-theme', plugins_url('wp-admin.css', __FILE__));
    }
    add_action('admin_enqueue_scripts', 'my_afs_theme_style');
    add_action('login_enqueue_scripts', 'my_afs_theme_style');

    ?>

    The wp-admin.css file in the plugin contains: `@import url("../twentyten/wp-admin.css");

    .media-menu {
    display: none;
    }
    .media-frame-content {
    border-left: 1px outset #AABBCC;
    }`

    I'd really appreciate if someone can point me in the right direction - if this is simpler just done as a child file or to do this plugin route... thank you

  2. jimii
    Member
    Posted 7 months ago #

    I've just noted an incorrect code line above with the source

    >> wp-admin/colors.min.css <<

    I am going to see if I can edit, test and solve it myself one more time - I'll re-post if not resolved...

  3. jimii
    Member
    Posted 7 months ago #

    I apologise for the erred code post above and the duplicate of this.

    I double checked the edit with colors.css and that didn't work either - I re-tried it as a file in the twenty-ten child theme and also as a file within the edited function plugin...

    If anyone can guide in the right direction - it is the colors.css file that I want to implement the following edits.

    .media-menu {
     display: none;
     }
     .media-frame-content {
     border-left: 1px outset #AABBCC;
     }

    thank you...

  4. jimii
    Member
    Posted 7 months ago #

    I've tried to restrict the media up-loader to its basic functions -> media library and upload images (either hiding the side panel on the up-loader or unsetting the links).

    I've tried this by unsetting the links but ideally it would be a function to only unset if not admin.

    Below I've modified a post by another user to unset the upload from url I added to that snippet to unset the 'set featured image" and create gallery as below.

    It works to unset the upload from url - but the other two (create gallery and feature image links) left 2 'media library' links behind... The function code I used was:

    function remove_media_tab($strings) {
     unset($strings["insertFromUrlTitle"]);
     unset($strings["setFeaturedImageTitle"]);
     unset($strings["createGalleryTitle"]);
     return $strings;
     }
     add_filter('media_view_strings','remove_media_tab');
     ?>

    As much as I've learned about coding here in the last year - I don't know enough to troubleshoot and finish this.

    Is there a better way to unset / hide the wp side-panel links for upload from url, create gallery and set featured image?

    I've posted here and in hacks, which might be the wrong place, so thank you for any guidance that can be provided. jim

Reply

You must log in to post.

About this Topic