Skip to content

Commit

Permalink
Merge pull request #31 from mundschenk-at/end-credits-for-pages
Browse files Browse the repository at this point in the history
Print end credits on pages
  • Loading branch information
mundschenk-at authored Feb 19, 2018
2 parents 99adc49 + 9a34dc5 commit 339287a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Media Credit #
**Contributors:** [pputzer](https://profiles.wordpress.org/pputzer)
**Tags:** media, image, images, credit, byline, author, user
**Requires at least:** 4.8
**Tested up to:** 4.8
**Requires at least:** 4.9
**Tested up to:** 4.9
**Stable tag:** 3.1.7

Adds a "Credit" field when uploading media to posts and displays it under the images
Expand Down Expand Up @@ -127,7 +127,8 @@ by <strong>leaving a message in the Wordpress.org [support forums here](https://

## Changelog ##

### 3.2.0 (Jun. xx, 2017) ###
### 3.2.0 (Feb. xx, 2018) ###
* "Display credit after posts" now works with pages as well as regular posts (and custom post types).
*

### 3.1.7 (Feb. 24, 2017) ###
Expand All @@ -141,7 +142,7 @@ by <strong>leaving a message in the Wordpress.org [support forums here](https://

### 3.1.5 (Jan. 29, 2017) ###
* Prevent invalid link nesting in featured image credits. This means that by default,
no `<a>` tags are printed for featured image credits. The old behaviour can
no `<a>` tags are printed for featured image credits. The old behavior can
be restored by including `add_filter( 'media_credit_post_thumbnail_include_links', __return_true );`
in the theme's `functions.php`.
* "Display credit after posts" is now restricted to the proper single post view
Expand Down
4 changes: 2 additions & 2 deletions public/class-media-credit-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ public function media_credit_shortcode( $atts, $content = null ) {
*/
public function add_media_credits_to_end( $content ) {

// Check if we're inside the main loop in a single post page.
if ( ! is_single() || ! in_the_loop() || ! is_main_query() ) {
// Check if we're inside the main loop in a single post/page/CPT.
if ( ! is_singular() || ! in_the_loop() || ! is_main_query() ) {
return $content; // abort.
}

Expand Down
7 changes: 4 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: pputzer
Tags: media, image, images, credit, byline, author, user
Requires at least: 4.9
Tested up to: 4.8
Tested up to: 4.9
Stable tag: 3.1.7

Adds a "Credit" field when uploading media to posts and displays it under the images
Expand Down Expand Up @@ -121,7 +121,8 @@ by <strong>leaving a message in the Wordpress.org [support forums here](https://

== Changelog ==

= 3.2.0 (Jun. xx, 2017) =
= 3.2.0 (Feb. xx, 2018) =
* "Display credit after posts" now works with pages as well as regular posts (and custom post types).
*

= 3.1.7 (Feb. 24, 2017) =
Expand All @@ -135,7 +136,7 @@ by <strong>leaving a message in the Wordpress.org [support forums here](https://

= 3.1.5 (Jan. 29, 2017) =
* Prevent invalid link nesting in featured image credits. This means that by default,
no `<a>` tags are printed for featured image credits. The old behaviour can
no `<a>` tags are printed for featured image credits. The old behavior can
be restored by including `add_filter( 'media_credit_post_thumbnail_include_links', __return_true );`
in the theme's `functions.php`.
* "Display credit after posts" is now restricted to the proper single post view
Expand Down

0 comments on commit 339287a

Please sign in to comment.