This website uses cookies to remember you and improve your experience. For more info see our Privacy Policy.

Mobile Menu

  • Menu
  • Skip to right header navigation
  • Skip to main content

Stormhill Media

Custom websites for every type of business

Header Right

  • About
  • Websites
    • Business Websites
    • Author Websites
  • SEO
  • Portfolio
  • Services & Pricing
    • Author Website Packages
    • Website Hosting
    • Page Speed Optimization
    • SEO
  • Plugins
    • MyBookTable
    • MyBookProgress
    • MySpeakingEvents
    • Plugin Support
  • Contact
  • Hire Us

Developer Resources

Home » Developer Resources

Custom Import Export

by Daniel Camomile · In: Developer Resources · on May 6, 2020

MyBookTable has a custom JSON import/export tool you can access from MyBookTable > Import Books. The JSON is formatted roughly is as follows: { “version”: string, // the plugin version that exported the file “authors”: [ // An array of author terms { “id”: number, // the exported term id, used for de-duplication “slug”: string, // the term slug used for the url “name”: string, // The term title displayed on the page “description”: string, // The term description “parent”: string, // The term parent identified by term NAME, not by slug or id (eg. “J.R.R. Tolkien”, not “j-r-r-tolkien” or …

Custom Import ExportRead More

Category: Developer Resources

General Hooks and Filters

by Daniel Camomile · In: Developer Resources · on May 6, 2020

Frontend Changes mbt_image_url – Allows you to filter the images used for Buy Buttons and other frontend styling mbt_style_folders – Allows you to filter the folders used to look for plugin styles mbt_book_rewrite_name – Allows you to change the book post type rewrite slug, defaults to ‘books’ mbt_author_rewrite_name – Allows you to change the author taxonomy rewrite slug, defaults to ‘authors’ mbt_genre_rewrite_name – Allows you to change the genre taxonomy rewrite slug, defaults to ‘genre’ mbt_series_rewrite_name – Allows you to change the series taxonomy rewrite slug, defaults to ‘series’

General Hooks and FiltersRead More

Category: Developer Resources

Buy Button Hooks and Filters

by Daniel Camomile · In: Developer Resources · on May 6, 2020

General Hooks mbt_stores – See Creating and Modifying Stores mbt_buybutton_editor – See Customizing Buy Button Editors mbt_filter_buybutton_data – See Customizing Buy Buttons mbt_format_buybutton – See Customizing Buy Buttons mbt_get_buybuttons – Allows you to filter all the Buy Buttons attached to a book mbt_buybutton_save – Allows you to filter the Buy Button data as it is saved

Buy Button Hooks and FiltersRead More

Category: Developer Resources

Customizing Buy Buttons

by Daniel Camomile · In: Developer Resources · on May 6, 2020

There are two primary ways of modifying how Buy Buttons display, the mbt_filter_buybutton_data filter, which allows you to temporarily modify the Buy Button’s data before it is displayed, and the mbt_format_buybutton filter, which lets you filter the entire button output. Filtering Buy Button Data The mbt_filter_buybutton_data filter works on each Buy Button’s $data variable, and can also provide the $store information that the Buy Button uses if you set the accepted_args variable in add_filter to 2. The $data variable will contain whatever data that the Buy Button editor saved in it, but the default Buy Button data that is used …

Customizing Buy ButtonsRead More

Category: Developer Resources

Customizing Buy Button Editors

by Daniel Camomile · In: Developer Resources · on May 6, 2020

The mbt_buybutton_editor filter allows you to modify or override the default Buy Button editor. Generally this is done on a per-store basis, but it can also be used to globally change all the editors. The filter provides four arguments: $output: The overall editor HTML that will be displayed. $data: The data for the Buy Button that you are editing. $id: The ID for this Buy Button. $store: The data for the store that the Buy Button is using. (See Creating and Modifying Stores) The $data variable will contain whatever data that the Buy Button editor saves in it, but the …

Customizing Buy Button EditorsRead More

Category: Developer Resources

Creating and Modifying Stores

by Daniel Camomile · In: Developer Resources · on May 6, 2020

MyBookTable includes an easy-to-use API for developers to add and modify the stores that the plugin supports. This is done mostly through the mbt_stores filter, which filters over the array of all stores. This allows you to insert a new store by adding an element to the array, remove an existing store by removing it’s element, or modify a store by changing it’s element data. Adding a New Store Only two pieces of information are required to add a new store to the array, the store’s slug and it’s name. The slug is simply a shortened name for the store …

Creating and Modifying StoresRead More

Category: Developer Resources

Template Override Examples

by Daniel Camomile · In: Developer Resources · on May 6, 2020

Override Archive Title You can insert the following snippet into your theme’s functions.php file to remove the taxonomy indicators that show up before the term title on the MyBookTable taxonomy archive page. The following example removes the “Genre:” indicator on genre archive pages. You can make this work for any of MyBookTable’s taxonomies by replacing ‘mbt_genre’ with the appropriate taxonomy slug (Authors: ‘mbt_author’, Series: ‘mbt_series’, Tags: ‘mbt_tag’). function mytheme_override_archive_title($output) { if(is_tax(‘mbt_genre’)) { $output = get_queried_object()->name; } return $output; } add_filter(‘mbt_get_book_archive_title’, ‘mytheme_override_archive_title’);

Template Override ExamplesRead More

Category: Developer Resources

Style Pack System

by Daniel Camomile · In: Developer Resources · on May 6, 2020

MyBookTable includes a Style Pack system that allows you to create new Style Packs that modify how your Buy Buttons look and feel and to override the existing styles included in MyBookTable. Anatomy of a Style Pack Style Packs are folders with three things in them: images for the Buy Buttons, a CSS file to override other MyBookTable styles, and a readme file that contains metadata about the Style Pack. The name of this folder is used as the Style Pack’s name, unless it is otherwise specified in the readme file. It’s recommended that Style Packs stay limited to affecting …

Style Pack SystemRead More

Category: Developer Resources

Template Functions and Hooks

by Daniel Camomile · In: Developer Resources · on May 6, 2020

General Hooks mbt_template_folders You can use this to add a custom folder that MyBookTable will look in when finding templates to render for your books. Example: function yourtheme_add_template_folder($folders) { $folders[] = get_template_directory().’/mybooktable_templates/’; return $folders; } add_filter(‘mbt_template_folders’, ‘yourtheme_add_template_folder’); (Note: MyBookTable will already look in the current theme directory for a “mybooktable” folder when looking for templates. mbt_content_wrapper_start This hook happens before a MyBookTable page when MyBookTable is not in Compatability Mode. It is used to render non-content parts of the theme such as the header. mbt_content_wrapper_end This hook happens after a MyBookTable page when MyBookTable is not in Compatability Mode. It …

Template Functions and HooksRead More

Category: Developer Resources

Template System Overview

by Daniel Camomile · In: Developer Resources · on May 6, 2020

The template files in the plugin under the templates folder contain the markup and template structure for the front-end of your MyBookTable pages. MyBookTable supports a way to edit these files in an upgrade safe way through overrides. Simply copy the template you want to override into a mybooktable directory within your theme, keeping the same file structure. Example: To overide the book archive header section, copy: wp-content/plugins/mybooktable/templates/archive-book/header.php to wp-content/themes/YOURTHEME/mybooktable/archive-book/header.php The copied file will then override the MyBookTable default template file. Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and …

Template System OverviewRead More

Category: Developer Resources

Fixing Theme Problems

by Daniel Camomile · In: Developer Resources · on May 6, 2020

General Theme Compatability As long as Compatability Mode is turned on, MyBookTable should integrate nicely with most WordPress themes. However some themes will show incorrect elements or strage layouts on MyBookTable pages. The first thing you can do to try to resolve this is to try taking the plugin out of Compatability Mode and seeing if that works better for you. This can actually solve layout issues on some themes, however with most themes using MyBookTable without Compatibility Mode will break your layout on MyBookTable pages by shifting your sidebars or page contents into incorrect positions. This happens because without …

Fixing Theme ProblemsRead More

Category: Developer Resources

How to Remove a Spam Comment

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

Spam is annoying.  The good news is that spam is a symptom of success. The more traffic your website gets, the more the spammers want to be on it. They are like flies attracted to the light of someone else’s popularity. To protect you from spam, we have installed Akismet spam protection which is the industry standard for dealing with spammers.  Just like with email spam filters, blog spam filters like Akismet work only about 99% of the time. So 1 in 100 spam comments gets through. This sounds good– until you start getting thousands of spam comments. Fortunately, clearing out spam is very simple. Here …

How to Remove a Spam CommentRead More

Category: Developer Resources

How to remove Google plus from share button links

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

If you want to hide it from your site and know how to get into css styles then here is all you need to do. .mbt-book .mbt-book-socialmedia-buttons .mbt-book-socialmedia-googleplus { display: none; }

How to remove Google plus from share button linksRead More

Category: Developer Resources

code for hiding tags on MBTbooktable page

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

The options you have are 1. not to use tags at all 2. Since this is open source code, you can go into the css styles and hide it. To do this you will need this bit of code This should hide the tag title and the tag: span.mbt-meta-item.mbt-meta-mbt_tag {     display: none; }

code for hiding tags on MBTbooktable pageRead More

Category: Developer Resources

How to hide the word Series in code

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

function mytheme_override_archive_title($output) { if(is_tax(‘mbt_series’)) { $output = get_queried_object()->name; } return $output; } add_filter(‘mbt_get_book_archive_title’, ‘mytheme_override_archive_title’);  

How to hide the word Series in codeRead More

Category: Developer Resources

Hiding labels for MBT titles

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

These labels can typically be easily hid by adding a line of code to your CSS.  A piece of CSS that many MyBookTable users have found helpful in the past for similar issues is: .post-1741 .mbt-book-archive-title {   display: none; }

Hiding labels for MBT titlesRead More

Category: Developer Resources

code to change title My Books

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

The “About the Book” text can’t be changed with a single snippet as it’s part of the overview template. The will need to copy the ‘templates/single-book-singlecolumn/overview.php’ and  ‘templates/single-book-storefront/overview.php’ files to a new folder in their theme called “mybooktable”, to “<my theme>/mybooktable/single-book-singlecolumn/overview.php”, to “<my theme>/mybooktable/single-book-storefront/overview.php”, respectively. They can then change the About the Book text in those files. They can read more about this template system on the developer wiki here: https://github.com/authormedia/mybooktable/wiki/Template-System-Overview If it’s something that’s commonly requested to override, I can add a filter in the next update to make it easier to change.  

code to change title My BooksRead More

Category: Developer Resources

How can I add custom data to an amazon import?

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

MyBookTable has a custom JSON import/export tool you can access from MyBookTable > Import Books. You can find a description of the JSON schema on our developer wiki here. By the way, we support 13-digit ISBNs, we just pull the canonical ISBN provided by Amazon through their API when importing from there, which is often 10-digit for whatever reason. ~Tim https://github.com/authormedia/mybooktable/wiki/Custom-Import-Export

How can I add custom data to an amazon import?Read More

Category: Developer Resources

tag order question

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

Is there a way to specify that one tag should display in order of the date the book was added, but have the rest display normally? Use this code – it worked.function custom_mbt_pre_get_posts($query) {    if($query->is_tax(‘mbt_tag’) and $query->get(‘mbt_tag’) == ‘TAG SLUG GOES HERE’) {        $query->set(‘orderby’, ‘post_date’);        $query->set(‘order’, ‘ASC’);    }}add_action(‘pre_get_posts’, ‘custom_mbt_pre_get_posts’, 50);

tag order questionRead More

Category: Developer Resources

Removing Genre word from MBT title

by Daniel Camomile · In: Developer Resources · on Apr 10, 2020

Unfortunately there is no built-in way to do this in the plugin. However if you know a PHP developer that can help you make a tweak to your theme or are comfortable making a change to your theme’s functions.php file yourself, it is quite easy to use MyBookTable’s customization functions to change this by adding the following code to your theme: function mytheme_override_archive_title($output) { if(is_tax(‘mbt_genre’)) { $output = get_queried_object()->name; } return $output; } add_filter(‘mbt_get_book_archive_title’, ‘mytheme_override_archive_title’); ~Tim  

Removing Genre word from MBT titleRead More

Category: Developer Resources

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Site Footer

Quick Links:

  • Contact Us
  • Pricing & Services
  • Sitemap
  • Terms/Conditions
  • Privacy Policy
  • Business Websites
  • Author Websites
  • SEO Services
(903) 213-5266‬

Copyright © 2023 · Stormhill Media All Rights Reserved.
Website by Stormhill Media
Log in