Skip to:
Content
Pages
Categories
Search
Top
Bottom

Question about bp_activity_action


  • Joshua Blevins
    Participant

    @jblevins1991

    Right now I am trying to make my own custom entry.php for my activity loops. When looking at the bp-default one to get a good idea of what one should look like i ran into the following code.

    <?php bp_activity_action(); ?>

    Now I found this function in bp-activity-template.php in the github project, but that was not too helpful either. The file doesn’t document the $args that it can take nor does it tell me too much information.

    
    /**
     * Output the activity action.
     *
     * @since 1.2.0
     *
     * @param array $args See bp_get_activity_action().
     * @uses bp_get_activity_action()
     */
    function bp_activity_action( $args = array() ) {
    	echo bp_get_activity_action( $args );
    }

    Anyone with some experience using this? If so can you clear up what this function does and how I can use it?

Viewing 4 replies - 1 through 4 (of 4 total)

  • shanebp
    Moderator

    @shanebp

    When looking at the bp-default one

    Unless you are explicitly using the bp-default theme, you should be looking at this file:
    buddypress\bp-templates\bp-legacy\buddypress\activity\entry.php

    As for the function, it says:
    * @uses bp_get_activity_action()

    So look at that function which you will find right below the one you looked at.
    And you will see:

     * @param array $args {
    	 *     @type bool $no_timestamp Whether to exclude the timestamp.

    Joshua Blevins
    Participant

    @jblevins1991

    I did look at that function as well.

    /**
    	 * Return the activity content.
    	 *
    	 * @since 1.0.0
    	 * @deprecated 1.5.0
    	 *
    	 * @todo properly deprecate this function.
    	 *
    	 * @uses bp_get_activity_action()
    	 * @uses bp_get_activity_content_body()
    	 * @uses apply_filters() To call the 'bp_get_activity_content' hook.
    	 *
    	 * @return string The activity content.
    	 */
    	function bp_get_activity_content() {
    		/**
    		 * If you want to filter activity update content, please use
    		 * the filter 'bp_get_activity_content_body'.
    		 *
    		 * This function is mainly for backwards compatibility.
    		 */
    		$content = bp_get_activity_action() . ' ' . bp_get_activity_content_body();
    		return apply_filters( 'bp_get_activity_content', $content );
    	}

    Do you know which file holds all of the buddypress specific filters and actions? I’d really like to dig deeper and understand those as well. I think that is what is holding me back from developing faster and better.


    shanebp
    Moderator

    @shanebp

    Do you know which file holds all of the buddypress specific filters and actions?

    They are mainly grouped according the component being used.
    Look in buddypress/bp-activity/ for activity related filters and actions.

    If you have a decent file editor ( notepad++ ? ) you can do a find-in-files search.


    Joshua Blevins
    Participant

    @jblevins1991

    Right now I am trying out Dreamweaver for production. However for a bit more versatility I am thinking about going back to Sublime Text. If not mainly for awesome plugins.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Question about bp_activity_action’ is closed to new replies.
Skip to toolbar