Hooks
Add Fonts
The plugin comes with several default fonts. It also supports the Adobe Fonts plugin without any extra programming.
Here’s an example of adding more fonts, such as a Google Font.
<?php
add_filter( 'ptam_fonts', function( $fonts ) {
$fonts['open sans'] = 'Open Sans';
return $fonts;
} );
Code language: PHP (php)
Remove Page Column
<?php
add_filter( 'ptam_add_pages_column', '__return_false' );
Code language: PHP (php)
Disable Image Sizes
The plugin creates two image sizes. Here’s how to disable them programmatically.
<?php
add_filter( 'ptam_add_image_sizes', '__return_false' );
Code language: PHP (php)
Customize Custom Field Output
The Custom Post Types block supports custom fields, but maybe you need to customize the output?
<?php
$custom_field_value = apply_filters( 'ptam_custom_field', $custom_field_value, $maybe_custom_field );
Code language: PHP (php)
<?php
add_filter( 'ptam_custom_field', function( $value, $custom_field_name, $post_id ) {
if ( 'my_field' === $custom_field_name ) {
return 'new value';
}
return $value;
},10, 3);
Code language: PHP (php)