Print My Blog icon
Backup & Migration

Print My Blog hooks reference

  • By Michael Nelson
  • v3.27.18
  • Updated

Print My Blog 3.27.18 has 27 actions and 49 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Print My Blog fires an action
add_action( 'AH_FormInputBase___construct__before_construct_finalize_called', function( $object, $options_array ) {
	// Your code runs here.
}, 10, 2 );

// Change a value Print My Blog is about to use
add_filter( 'pmb-print-page-treat-as-single', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • src/Twine/forms/base/FormSection.php line 161
    /**
     * Gives other plugins a chance to hook in before construct finalize is called.
     * The form probably doesn't yet have a parent form section. Since 4.9.32, when
     * this action was introduced, this is the best place to add a subsection onto
     * a form, assuming you don't care what the form section's name, HTML ID, or
     * HTML name etc are. Also see AH_FormSectionProper___construct_finalize__end
     */
    do_action( 'AH_FormInputBase___construct__before_construct_finalize_called', $this, $options_array );
  • src/Twine/forms/base/FormSection.php line 242
    /**
     * Action performed just after form has been given a name (and HTML ID etc) and
     * is fully constructed. If you have code that should modify the form and needs
     * it and its subsections to have a name, HTML ID (or other attributes derived
     * from the name like the HTML label id, etc), this is where it should be done.
     * This might only happen just before displaying the form, or just before it
     * receives form su...
     */
    do_action( 'AH_FormSectionProper___construct_finalize__end', $this, $parent_form_section, $name );
  • templates/print_page.php line 14
    /**
     * The header for our printing
     */
    apply_filters( 'pmb-print-page-treat-as-single', true );
  • src/PrintMyBlog/controllers/Admin.php line 1481
    /**
     * Hook for doing more processing after a design is customized
     */
    do_action( 'PrintMyBlog\\controllers\\Admin->saveProjectCustomizeDesign done', $this->project, $project_generation, $design, $design_form );
  • src/PrintMyBlog/controllers/Admin.php line 1560
    /**
     * Hook for doing more processing when project metadata is saved.
     */
    do_action( 'PrintMyBlog\\controllers\\Admin->saveProjectMetadata done', $this->project, $project_generations, $form );
  • src/PrintMyBlog/controllers/Frontend.php line 161
    /**
     * Lets you override if Print My Blog adds print buttons or not.
     */
    apply_filters( 'PrintMyBlog\controllers\PmbFrontend->addPrintButtons $show_buttons', ( isset($active_post_types[$post->post_type]) && $active_post_types[$post->post_type] && (is_single() || $post->post_type === 'page') && ! post_password_required($post) && $postmeta_override !== 'hide' ) || $postmeta_override === 'show', $post, $pmb_print_settings, $postmeta_override );
  • src/PrintMyBlog/controllers/Frontend.php line 111
    /**
     * Allows changing the priority of the print buttons to place them above or
     * below other content automatically added.
     */
    apply_filters( 'PrintMyBlog\controllers\PmbFrontend->setHooks $priority', 10 );
  • the_meta_key

    filter
    inc/template_functions.php line 274
    /**
     * Filters the HTML output of the li element in the post custom fields list.
     */
    apply_filters( 'the_meta_key', $html, $key, $value );
  • src/mnelson4/AdminNotices/Notice.php line 157
    /**
     * Allow filtering the allowed HTML tags array.
     */
    apply_filters( 'wptrt_admin_notices_allowed_html', $this->allowed_html );
  • designs/epub/classic/templates/project.php line 10 · used in 4 places
    do_action( 'pmb_pro_print_window' );
  • templates/partials/pro_print_page_epub_window.php line 35 · used in 3 places
    do_action( 'pmb_pro_print_page_window_end', 'epub' );
  • src/PrintMyBlog/controllers/Admin.php line 770 · used in 2 places
    apply_filters( '\\PrintMyBlog\\controllers\\Admin::enqueueScripts doc_attrs', [ 'test' => ( defined( 'PMB_TEST_LIVE' ) && PMB_TEST_LIVE ? true : false ), 'type' => 'pdf', 'javascript' => true, 'name' => $this->project->getPublishedTitle(), 'ignore_console_messages' => true, 'ignore_resource_errors' => true, 'pipeline' => '10.1', 'prince_options' => [ 'base_url' => site_url(), 'media' => 'print', 'http_timeout' => 60, 'http_insecure' => true, ], ] );
  • src/PrintMyBlog/compatibility/plugins/Wpml.php line 648 · used in 2 places
    do_action( 'wpml_sync_all_custom_fields', $design->getWpPost()->ID );
  • src/Twine/admin/news/DashboardNews.php line 219
    apply_filters( "{$this->slug}_dashboard_news_items_count", $this->item_count );
  • src/PrintMyBlog/controllers/Admin.php line 756
    apply_filters( '\\PrintMyBlog\\controllers\\Admin->enqueueScripts generate generate_ajax_data', [ 'action' => Frontend::PMB_PROJECT_STATUS_ACTION, 'ID' => $this->project->getWpPost()->ID, '_nonce' => wp_create_nonce( 'pmb-loading' ), ], $this->project );
  • src/PrintMyBlog/controllers/Admin.php line 1356
    do_action( '\\PrintMyBlog\\controllers\\Admin->saveNewProject', $this->project, $form );
  • src/PrintMyBlog/controllers/Admin.php line 761
    apply_filters( '\\PrintMyBlog\\controllers\\Admin::enqueueScripts pmb_ajax', pmb_ajax_url(), $this->project );
  • src/PrintMyBlog/controllers/Admin.php line 762
    apply_filters( '\\PrintMyBlog\\controllers\\Admin::enqueueScripts site_url', site_url(), $this->project );
  • src/PrintMyBlog/controllers/Admin.php line 1274
    apply_filters( '\\PrintMyBlog\\controllers\\Admin::getSetupForm', new FormSection([ 'name' => 'pmb-project', 'subsections' => [ 'title' => new TextInput([ 'html_label_text' => __( 'Project Title', 'print-my-blog' ), 'required' => true, 'default' => ( $this->project instanceof Project ? $this->project->getWpPost()->post_title : '' ), 'other_html_attributes' => ['autofocus'], ]), 'formats' => new CheckboxMultiInput($format_options, [ 'html_label_text' => __( 'F... );
  • src/PrintMyBlog/controllers/Frontend.php line 260
    apply_filters( '\PrintMyBlog\controllers\Admin->enqueueScripts generate generate_ajax_data', [ 'action' => Frontend::PMB_PROJECT_STATUS_ACTION, 'ID' => $this->project->getWpPost()->ID, '_nonce' => wp_create_nonce('pmb-loading'), 'format' => $format, self::PMB_USE_THEME =>$use_theme ? '1' : '0', ] );
  • src/PrintMyBlog/controllers/Frontend.php line 280
    apply_filters( '\PrintMyBlog\controllers\Admin::enqueueScripts doc_attrs', [ 'test' => defined('PMB_TEST_LIVE') && PMB_TEST_LIVE ? true : false, 'type' => 'pdf', 'javascript' => true, 'name' => $this->project->getPublishedTitle(), 'ignore_console_messages' => true, 'ignore_resource_errors' => true, 'pipeline' => '10.1', 'prince_options' => [ 'base_url' => site_url(), 'media' => 'print', 'http_timeout' => 60, 'http_insecure' => true, ], ] );
  • src/PrintMyBlog/controllers/Ajax.php line 307
    apply_filters( '\PrintMyBlog\controllers\Ajax->handlePostSearch $posts', $posts, $query_params );
  • src/PrintMyBlog/controllers/Ajax.php line 306
    apply_filters( '\PrintMyBlog\controllers\Ajax->handlePostSearch $query_params', $query_params );
  • src/PrintMyBlog/controllers/Frontend.php line 177
    apply_filters( '\PrintMyBlog\controllers\PmbFrontend->addPrintButton $add_to_top', $pmb_print_settings->showButtonsAbove(), $post );
  • src/PrintMyBlog/domain/PrintPageUrlGenerator.php line 87
    apply_filters( '\PrintMyBlog\controllers\PmbFrontend->addPrintButton $base_args', $args, $this->post, $slug, $this->print_settings->formatSettings($slug) );
  • src/PrintMyBlog/controllers/Shortcodes.php line 186
    apply_filters( '\PrintMyBlog\controllers\Shortcodes->tableOfContents', '<div class="pmb-toc"> <ul id="pmb-toc-list" class="pmb-toc-list "> <!-- Populated dynamically by JS --> </ul> </div>' );
  • src/PrintMyBlog/entities/ProjectGeneration.php line 182
    apply_filters( '\PrintMyBlog\entities\ProjectGeneration::getGeneratedIntermediaryFileUrl return', $start . '/pmb/generated/' . $this->project->code() . '/' . $this->format->slug() . '/' . rawurlencode($this->getFileName()) . '.html?uniqueness=' . current_time('timestamp'), $this );
  • src/PrintMyBlog/services/generators/EpubGenerator.php line 105
    apply_filters( '\PrintMyBlog\services\generators\EpubGenerator::enqueueStylesAndScripts $css', $css, $this->design, $this->project );
  • src/PrintMyBlog/services/generators/HtmlBaseGenerator.php line 88
    do_action( '\PrintMyBlog\services\generators\ProjectFileGeneratorBase->finishGenerating', $this );
  • src/PrintMyBlog/services/generators/ProjectFileGeneratorBase.php line 346
    do_action( '\PrintMyBlog\services\generators\ProjectFileGeneratorBase->getHtmlFrom after_get_clean' );
  • src/PrintMyBlog/services/generators/ProjectFileGeneratorBase.php line 330
    do_action( '\PrintMyBlog\services\generators\ProjectFileGeneratorBase->getHtmlFrom before_ob_start' );
  • src/PrintMyBlog/services/generators/ProjectFileGeneratorBase.php line 184
    apply_filters( '\PrintMyBlog\services\generators\ProjectFileGeneratorBase->sortPostsAndAttachSections $sections', $sections, $this, $unordered_posts );
  • src/PrintMyBlog/services/generators/ProjectFileGeneratorBase.php line 151
    do_action( '\PrintMyBlog\services\generators\ProjectFileGeneratorBase->startGenerating', $this );
  • src/Twine/services/config/Config.php line 114
    apply_filters( '\Twine\services\config\Config::getSetting', $this->settings[$setting_name], $setting_name, static::class, $this->settings );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 290
    apply_filters( "AF_Form_Section_Layout__{$hook_name}__html", $html, $this->form_section );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 289
    do_action( "AH_Form_Section_Layout__{$hook_name}", $this->form_section );
  • src/Twine/forms/inputs/FormInputBase.php line 275
    do_action( 'AH_FormInputBase___construct_finalize__end', $this, $parent_form_section, $name );
  • src/Twine/forms/base/FormSection.php line 824
    do_action( 'AH_FormSectionProper__localize_script_for_all_forms__begin' );
  • src/Twine/forms/base/FormSection.php line 355
    do_action( 'AH_FormSectionProper__receive_form_submission__end', $req_data, $this, $validate );
  • src/Twine/forms/strategies/display/DisplayBase.php line 176
    apply_filters( 'FH_DisplayBase__attributes_string__attributes', $attributes, $this, $this->input );
  • src/Twine/forms/strategies/validation/EqualToValidation.php line 34
    apply_filters( 'FH_EqualToValidation____construct__validation_error_message', esc_html__('Fields do not match.', 'print-my-blog') );
  • src/Twine/forms/inputs/FormInputBase.php line 196
    apply_filters( 'FH_FormInputBase___construct__input_args', $input_args, $this );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 217
    apply_filters( 'FH_FormSectionLayoutBase__display_form_wide_errors', $html, $this );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 84
    apply_filters( "FH_FormSectionLayoutBase__layout_form__end__for_{$this->form_section->name()}", $this->layoutFormEnd(), $this->form_section );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 78
    apply_filters( "FH_FormSectionLayoutBase__layout_form__loop__for_{$this->form_section->name()}", $this->layoutFormLoop(), $this->form_section );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 105
    apply_filters( "FH_FormSectionLayoutBase__layout_form__loop_for_input_{$name}__in_{$this->form_section->name()}", $this->layoutInput($subsection), $this->form_section, $subsection );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 113
    apply_filters( "FH_FormSectionLayoutBase__layout_form__loop_for_non_input_{$name}__in_{$this->form_section->name()}", $this->layoutSubsection($subsection), $this->form_section, $subsection );
  • src/Twine/forms/strategies/layout/FormSectionLayoutBase.php line 72
    apply_filters( "FH_FormSectionLayoutBase__layout_form__start__for_{$this->form_section->name()}", $this->layoutFormBegin(), $this->form_section );
  • src/Twine/forms/base/FormSection.php line 118
    apply_filters( 'FH_FormSectionProper___construct__options_array', $options_array, $this );
  • src/Twine/forms/base/FormSection.php line 303
    apply_filters( 'FH_FormSectionProper__receive_form_submission__req_data', $req_data, $this );
  • src/Twine/forms/base/FormSection.php line 313
    apply_filters( 'FH_FormSectionProper__receive_form_submission__request_data', $req_data, $this );
  • src/Twine/forms/strategies/display/RadioButtonDisplay.php line 89
    apply_filters( 'FH_RadioButtonDisplay__display', $html, $this, $this->input );
  • src/Twine/forms/strategies/display/RadioButtonDisplay.php line 39
    apply_filters( 'FH_RadioButtonDisplay__display__option_label_class', 'twine-radio-label', $this, $input, $value );
  • src/Twine/forms/strategies/display/TextInputDisplay.php line 46
    apply_filters( 'FH_TextInputDisplay__use_html5_email', false );
  • templates/project_edit_content.php line 55
    do_action( 'pmb__project_edit_content__filters_top', $project );
  • inc/internal_functions.php line 245
    do_action( 'pmb_content_items__project-item-title end', $id, $title, $post_type, $template, $subs, $depth );
  • inc/design_functions.php line 172
    apply_filters( 'pmb_design_settings', $settings, $design );
  • pmb_fs_loaded

    action
    printmyblog.php line 203
    do_action( 'pmb_fs_loaded' );
  • inc/internal_functions.php line 131
    apply_filters( 'pmb_map_section_to_division', pmb_map_section_height_to_division( $section->getHeight() ), $section );
  • src/PrintMyBlog/services/generators/HtmlBaseGenerator.php line 51
    do_action( 'pmb_pdf_generation_start', $this->project_generation, $this->design );
  • templates/print_page.php line 329
    do_action( 'pmb_print_page_after_posts' );
  • templates/print_page.php line 315
    do_action( 'pmb_print_page_after_printed_on', $pmb_show_date_printed, $pmb_show_credit );
  • templates/print_page.php line 74
    do_action( 'pmb_print_page_ready_instructions_start' );
  • src/PrintMyBlog/domain/DefaultDesigns.php line 408
    do_action( 'pmb_register_designs' );
  • src/PrintMyBlog/domain/DefaultDesignTemplates.php line 718
    apply_filters( 'PrintMyBlog\\domain\\DefaultDesignTemplates->getGenericDesignForm', new FormSection([ 'subsections' => [ 'image' => new FormSection([ 'subsections' => [ 'image_quality' => new SelectInput($image_quality_options, [ 'html_label_text' => __( 'Image Quality (in pixels)', 'print-my-blog' ), 'html_help_text' => sprintf( __( 'Lower quality means smaller file size, whereas higher quality means higher resolution images. Note: if images are missing from the generated PDF... );
  • src/PrintMyBlog/domain/DefaultDesignTemplates.php line 735
    apply_filters( 'PrintMyBlog\\domain\\DefaultDesignTemplates->getGenericDesignFormSections', [ 'use_theme' => new YesNoInput([ 'html_label_text' => __( 'Apply Website Theme', 'print-my-blog' ), 'html_help_text' => $use_theme_help_text, 'default' => false, ]), 'custom_css' => new TextAreaInput([ 'html_label_text' => __( 'Custom CSS', 'print-my-blog' ), 'html_help_text' => __( 'Styles to be applied only when printing projects using this design.', 'print-my-blog' ), ]), 'powered_by' => ne... );
  • src/PrintMyBlog/services/generators/PdfGenerator.php line 146
    apply_filters( 'PrintMyBlog\\services\\generators\\PdfGenerator->printScripts prince_js_vars', $prince_js_vars, $this->project_generation );
  • src/PrintMyBlog/controllers/LegacyPrintPage.php line 253
    do_action( 'PrintMyBlog\controllers\PmbPrintPage->enqueueScripts' );
  • src/PrintMyBlog/domain/DefaultProjectContents.php line 39
    apply_filters( 'PrintMyBlog\domain\DefaultProjectContents->getDefaultContents()', [ 'pmb-title-page' => [ 'post_title' => __('Title Page', 'print-my-blog'), 'post_content' => '[pmb_title_page]', ], 'pmb-toc' => [ 'post_title' => __('Table of Contents', 'print-my-blog'), 'post_content' => '[pmb_toc]', ], ] );
  • src/PrintMyBlog/domain/PrintOptions.php line 185
    apply_filters( 'PrintMyBlog\domain\PrintOptions->troubleshootingOptions rendering_wait default', 200 );
  • src/PrintMyBlog/services/ExternalResourceCache.php line 140
    apply_filters( 'PrintMyBlog\services\ExternalResourceCache->domainsToNotMap()', [ str_replace(['http://', 'https://'], '', site_url()), '.wp.com', 'data:', ] );
  • src/PrintMyBlog/services/generators/ProjectFileGeneratorBase.php line 337
    apply_filters( 'PrintMyBlog\services\generators\ProjectFileGeneratorBase::getHtmlFrom clean_multiple_buffers', defined('CT_VERSION') );
  • src/PrintMyBlog/system/Activation.php line 150
    do_action( 'PrintMyBlog\system\Activation->install done', $this );
  • templates/project_edit_generate.php line 67
    do_action( 'project_edit_generate__under_header', $project, $generations );
  • src/Twine/forms/strategies/validation/FullHtmlValidation.php line 113
    apply_filters( 'Twine\forms\strategies\validation\FullHtmlValidation::getAllowedTags', $tags_we_allow );

Generated from Print My Blog's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: