Giter Site home page Giter Site logo

use-child-theme's People

Contributors

mgibbs189 avatar webmandesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

use-child-theme's Issues

Screencast does not show actual behavior

Disclaimer: super, super nitpicky detail – I understand if it's not worth bothering with

I was initially confused because the screencast shows the notice appearing on Appearance —> Themes, but in reality the notice only shows on Appearance —> Editor.

Prevent XSS Vulnerability

Use the WP Filesystem API

Right now, the script uses file_put_contents(). This would fail the WordPress.org Theme Check. I imagine it'll fail ThemeForest's check too. If the intention is to add this to themes, you'd want to make sure the code would pass at those two places.

Here's a link to the WP Filesystem API: https://codex.wordpress.org/Filesystem_API

FWIW as a WordPress theme review admin, I doubt we'd allow this type of script within themes in the directory. It'd probably fall under what we consider "plugin territory". However, if you want to make a case for allowing it in themes, you'll want to make sure it's using the Filesystem API.

Text domain

As far as I know, there should be only 1 text domain used in a WordPress theme.

So, I suggest renaming the text domain in the script from use-child-theme to parent-theme-slug (or similar) and making a note in description that theme developer should change this text domain to match the (parent) theme (where this script is included) slug.

What do you say?

PS: I'm not really a fan of modifying scripts included in the theme, but this is the only way we can resolve this issue I think.

Loading files within a theme

This isn't a recommended usage:

include( dirname( __FILE__ ) . '/use-child-theme.php' );

Option A:
include get_template_directory() . '/use-child-theme.php';

Option B:
require get_template_directory() . '/use-child-theme.php';

Great!

I haven't looked through all the code yet but I do see it moves over the theme_mods - great! That's something a lot of the child theme generators miss. Nice work ;)

Does not work

Hi Matt,

I created a blank wp install. Uploaded the plugin into the plugins folder and activated it. I guess it then should work and give me the option in the themes area.

But nothing shows. What am i missing here?

The file (plugin) is loaded.

Best regards,
BackuPs

Multiple parent styles loaded

For themes that enqeue the parent theme style, this code added to functions.php means that the parent theme's style.css file will be loaded twice:

function child_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles' );

I'm not sure how you account for different methods that themes use to load styles though, so I don't have any brilliant ideas on how to best handle this.

Allow text domain to be overridable with a filter

When using this class inside a theme, theme authors will want to localize the strings with their text domain to provide unified translations.

I suggest providing a filter that will allow theme authors to override the text domain without hacking into this class.

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.