• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Create Generic Override of Custom Genesis Function/Variables via Plugin

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Create Generic Override of Custom Genesis Function/Variables via Plugin

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 12 years, 4 months ago by Derek.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 20, 2013 at 6:23 pm #46973
    Derek
    Member

    I realize this may be way out of the scope of help, but someone might be able to give me a better answer than anything I've been able to find online.

    I've been putting together a plugin that allows me to modify elements of the Comment Form on a post-by-post basis. The WP core uses the "comment_form_defaults" function to handle the fields in the comment form. My code simply replaces this function with a new one.

    add_filter( 'comment_form_defaults', 'custom_comment_form_variables' );
    function custom_comment_form_variables( $arg ) {
    }

    This works fine on a WP install using a theme such as Twenty Twelve, but the Genesis framework replaces the "comment_form_defaults" function with it's own "genesis_comment_form_args" function. To make my code work isn't difficult, I just have to unhook the "genesis_comment_form_args" function and then re-hook it with my new variables.

    remove_filter( 'genesis_comment_form_args', 'custom_comment_form_args' );
    add_filter( 'genesis_comment_form_args', 'custom_comment_form_variables' );
    function custom_comment_form_variables( $arg ) {
    }

    But I'm wondering if there is a way to override (or bypass the need to unhook) the Genesis function via a more generic method, without having to specifically address the "genesis_comment_form_args" function (if that makes sense). Essentially, I want to be able to use this code/plugin on any site, regardless of parent framework or existing functions.

    I'll admit I'm probably in a little over my head on this, but any insight on the topic would be greatly appreciated. Thanks!


    Derek Rippe – CSS Artist & Genesis Fanboy @ SynaVista and MediaCairn Design Studio
    Figure out your CSS problems with Firebug | Check out my Custom Comment Form Title plugin

    June 21, 2013 at 11:09 am #47061
    Brad Dalton
    Participant

    I'd try tweeting this using the #genesiswp hashtag. That's where all the Genesis Developers connect. You might need to write a post about it on your blog.


    Tutorials for StudioPress Themes.

    June 21, 2013 at 11:15 am #47062
    Derek
    Member

    Thanks Brad. I'll see who I can connect with via Twitter.


    Derek Rippe – CSS Artist & Genesis Fanboy @ SynaVista and MediaCairn Design Studio
    Figure out your CSS problems with Firebug | Check out my Custom Comment Form Title plugin

    June 21, 2013 at 11:19 am #47065
    Brad Dalton
    Participant

    There is also a blog post on Yoast related to this which you may find useful.http://yoast.com/standard-wordpress-theme-hooks/


    Tutorials for StudioPress Themes.

    June 21, 2013 at 11:39 am #47068
    Derek
    Member

    Indeed. And Yoast isn't the only one pushing for it: https://github.com/zamoose/themehookalliance

    It further confirms my suspicion that, at this point, there is no "generic" method for overriding WP hooks that have already been unhooked and/or replaced/modified with a custom function.

    Ultimately, I'd love to have this plugin I'm developing be available to everyone via the WordPress Plugin Directory, which is why I'm looking for a simple way to accommodate all themes/frameworks. In the meantime, I may just need to setup an admin page that requires the user to select their Framework and apply the appropriate code accordingly.


    Derek Rippe – CSS Artist & Genesis Fanboy @ SynaVista and MediaCairn Design Studio
    Figure out your CSS problems with Firebug | Check out my Custom Comment Form Title plugin

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble