WordPress.org

Ready to get started?Download WordPress

Forums

Connections Business Directory
[resolved] Changing Field Names (3 posts)

  1. toddtoven
    Member
    Posted 1 year ago #

    Greetings,

    Anybody have any suggestions on changing field names such as "Organization" or "Department"? Found something at http://wordpress.org/support/topic/changing-field-names?replies=3 but don't want to alter the class.options.php file as it makes it more problematic to update the plugin in the future.

    I considered using the custom CSS, but it didn't seem to work or perhaps my CSS isn't correct. Tested using Chrome 23:

    label[for=organization]:before {
    	content:"Test ";
    }

    In the above example I'm trying to edit the field in the Connections > Add Entry settings panel.

    http://wordpress.org/extend/plugins/connections/

  2. shazahm1
    Member
    Plugin Author

    Posted 1 year ago #

    @toddtoven

    Are you comfortable with PHP? You can customize the stings using the gettext filter. Here's an example. Just drop this in the theme's functions.php file.

    function toddtoven_gettext( $translated_text , $text , $domain )  {
        if ( $domain == 'connections' && $translated_text == 'Organization' ) {
            $translated_text = 'My New Text';
        }
        if ( $domain == 'connections' && $translated_text == 'Department' ) {
            $translated_text = 'My New Text';
        }
        return $translated_text;
    }
    
    add_filter( 'gettext', 'toddtoven_gettext', 20, 3 );
  3. toddtoven
    Member
    Posted 1 year ago #

    best function name ever. thanks steven!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.