' . __( 'Configure Document Gallery', 'document-gallery' ) . ''; $body = '

' . __( 'Did you know Document Gallery has lots of configurable settings allowing you to fine tune ' . 'what your users experience when viewing a gallery? Click the Settings ' . 'link above to see for yourself!', 'document-gallery' ) . '

'; self::printFeaturePointer( '#the-list #document-gallery .row-actions', array( 'content' => $title . $body, 'position' => 'top' ) ); } /** * Feature pointer for Thumber.co tab in DG settings. */ public static function dg41_2FeaturePointer() { $title = '

' . __( 'More Thumbnails!', 'document-gallery' ) . '

'; $body = '

' . __( 'If you need to generate thumbnails for Word documents, PowerPoints, and more then you ' . 'need to check out Thumber.co. Free 1-week trial for a limited time! Click the ' . 'Thumber.co tab above to get started.', 'document-gallery' ) . '

'; self::printFeaturePointer( '#thumber-co-tab-header', array( 'content' => $title . $body, 'position' => 'top' ) ); } /** * Print the pointer JavaScript data. * NOTE: Taken from WP_Internal_Pointers. * * @param string $selector The HTML elements, on which the pointer should be attached. * @param mixed[] $args Arguments to be passed to the pointer JS (see wp-pointer.js). */ private static function printFeaturePointer( $selector, $args ) { if ( empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) return; $trace = debug_backtrace(); $pointer_id = self::getFeaturePointerIdFromMethodName( $trace[1]['function'] ); ?> getMethods( ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC ); self::$feature_pointer_methods = array_map( array( __CLASS__, 'getNameFromMethod' ), array_filter( $methods, array( __CLASS__, 'isFilterPointerMethod' ) ) ); } return self::$feature_pointer_methods; } /** * @param $method ReflectionMethod The method to extract name from. */ private static function getNameFromMethod( $method ) { return $method->name; } /** * @param $method ReflectionMethod The method name. * @return bool Whether the method name matches the filter pointer pattern. */ private static function isFilterPointerMethod( $method ) { // NOTE: ReflectionClass returns methods that are static OR public -- must reduce to an AND return $method->isPublic() && $method->isStatic() && DG_Util::endsWith( $method->name, self::$feature_pointer_method_suffix ); } }