ap_get_addon_image( string $file )

Description #

Get addon image.

Parameters #

  • $file
    string (Required) Addon main file name. Example: avatar.php or category.php.

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: includes/functions.php

function ap_get_addon_image( $file ) {
	$addon = ap_get_addon( $file );

	if ( isset( $addon['path'] ) ) {
		$path_parts = pathinfo( $addon['path'] );
		if ( isset( $path_parts['dirname'] ) && file_exists( $path_parts['dirname'] . '/image.png' ) ) {
			return plugin_dir_url( $addon['path'] ) . '/image.png';
		}
	}
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment