Results 1 to 3 of 3

Thread: Making string changes to functions

  1. #1
    Thread Starter
    isela808's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Making string changes to functions

    What is the AppTheme's preferred way to make changes to strings functions in Classipress 3.3 that aren't in template files? Should be be able to hook/unhook functions in a child theme or are we expected to use translation files?

    I ask because for some reason, this code isn't working to remove the default function (I'm getting both the new and old). I don't see the action getting moved to a different hook or priority, so I'm not sure why the remove_action is not working:

    (in child theme functions.php I've got)
    Code:
    remove_action( 'appthemes_after_post_content', 'cp_do_ad_ref_id' );  // Remove not working
    function bkf_do_ad_ref_id() {
    	global $post;
    	if ( ! is_singular( APP_POST_TYPE ) )
    		return;
    ?>		
    	<div class='note'><strong><?php _e( 'Reference ID:', APP_TD ); ?></strong> <?php if ( get_post_meta( $post->ID, 'cp_sys_ad_conf_id', true ) ) echo get_post_meta( $post->ID, 'cp_sys_ad_conf_id', true ); else _e( 'N/A', APP_TD ); ?></div>
        <div class="dotted"></div>
        <div class="pad5"></div>
    <?php
    }
    add_action( 'appthemes_after_post_content', 'bkf_do_ad_ref_id' );
    You can see the only change there is "Ad Reference ID:" has been changed to "Reference ID:". I'd prefer doing it this way then messing with translation files, but I'll do whatever works. I need to change a dozen string in a dozen functions and having the same problem with modifiying the strings in the step functions /includes/forms/step-functions.php.

    Side note, you seem to load these things with include_once or require_once, perhaps that could be changed to get_template or get_template_part so child themes could over ride them? Maybe I'm missing some obvious reason why that's not already the case though...

    Thanks

  2. #2
    tcarter's Avatar
    Join Date
    Jun 2011
    Location
    United States
    Posts
    424
    Thanks
    15
    Thanked 91 Times in 77 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    isela808's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Where can this string?
    By louisbuilders in forum ClassiPress General Discussion
    Replies: 2
    Last Post: November 21st, 2012, 06:16 AM
  2. Where can this string?
    By louisbuilders in forum ClassiPress General Discussion
    Replies: 1
    Last Post: November 6th, 2012, 07:21 AM
  3. [MOD NEEDED] Making modifications to functions
    By coza in forum JobRoller General Discussion
    Replies: 1
    Last Post: January 25th, 2012, 07:32 AM
  4. Reasoning behind putting everything into functions and sub functions?
    By rodeoramsey in forum Report ClassiPress Bugs
    Replies: 12
    Last Post: November 16th, 2011, 11:05 AM
  5. Search String???
    By stephanie in forum ClassiPress General Discussion
    Replies: 0
    Last Post: October 20th, 2010, 12:32 PM