WPIntell

Source evidence

Help with creating short code

Author Image · support · 2015-01-06T15:12:00+00:00

mixedsentiment
mediumseverity
0.78relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 25 rows with source links

8.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Sumo1 resolved
Hi, I’m trying to create short code to use in the wordpress admin content editors. Not sure if I’m using the correct row in the db, and I can’t find anything in your documentation showing where the data is inserted in wpdb. So far I have this, but it’s not working: $results = $wpdb->get_row($sql,ARRAY_A); $surfschool_name = $results['display_name']; $surfschool_email = $results['user_email']; $surfschool_logo = $results['author_image']; Then I’m using an array like this: array( 'surfschool' => $surfschool_name, 'surfschoolemail' => $surfschool_email, 'surfschoollogo' => $surfschool_logo ) Both [surf school] and [surfschoolemail] work perfectly as short code but [surfschoollogo] does not. Have you got any suggestions? Thanks https://wordpress.org/plugins/sem-author-image/ The plugin does not use the database for the image location. Instead it uses a uses a folder in wp-content and checks for the existance of an image file for the given author. Actually it does, I worked it out. This returns the file name. $sql_author_image = "SELECT meta_value FROM wp_usermeta WHERE user_id = $user_id AND meta_key = 'author_image' "; $author_image = $wpdb->get_var($sql_author_image); Then all you have to do is create an add_shortcode function. 4.9 version supports [author-image] shortcode for displaying in th epost/page content.

Comments

3 shown
Mike Koepke 2015-01-12T20:43:00+00:00

The plugin does not use the database for the image location. Instead it uses a uses a folder in wp-content and checks for the existance of an image file for the given author.

Sumo1 2015-01-13T07:48:00+00:00

Actually it does, I worked it out. This returns the file name. $sql_author_image = "SELECT meta_value FROM wp_usermeta WHERE user_id = $user_id AND meta_key = 'author_image' "; $author_image = $wpdb->get_var($sql_author_image); Then all you have to do is create an add_shortcode function.

Mike Koepke 2015-08-24T20:32:00+00:00

4.9 version supports [author-image] shortcode for displaying in th epost/page content.