Skip to content

Commit d945122

Browse files
committed
Optimize fakerpress load check, refactor attachment method name
1 parent a34076c commit d945122

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

framework/Objects/Post_Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ protected function __construct() {
240240
}
241241

242242
add_action( 'init', array( $this, 'init' ) );
243-
if ( method_exists( $this, 'faker' ) && FakerPress::check_requirements() && is_admin() ) {
243+
if ( method_exists( $this, 'faker' ) && is_admin() && FakerPress::check_requirements() ) {
244244
add_action( 'init', array( $this, 'init_faker' ) );
245245
}
246246
add_filter( 'template_include', array( $this, 'views' ), 10 );

framework/Supports/FakerContent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FakerContent {
2424
public $faker;
2525

2626
/**
27-
* Faker Press custom providers
27+
* FakerPress plugin custom providers
2828
*
2929
* @var array
3030
*/
@@ -183,7 +183,7 @@ public function words( $qty = 3 ) {
183183
*
184184
* @return int|string
185185
*/
186-
public function attachment_generated( $width = 1100, $height = 800, $type = 'id' ) {
186+
public function image_attachment( $width = 1100, $height = 800, $type = 'id' ) {
187187
$color = substr( md5( microtime( true ), false ), 0, 6 );
188188
$attach_url = "http://via.placeholder.com/{$width}x{$height}/$color";
189189

0 commit comments

Comments
 (0)