Is there a way to index results from Vimeography Pro Wordpress Plugin using Algolia Search?
The Algolia plugin for WordPress allows you to index any post type.
If the Vimeography Pro uses custom post types, you will be able to index them. If it introduces custom attributes, you will need to push those by using hooks.
You'll find more details about how to extend the Algolia plugin in the official documentation here: https://community.algolia.com/wordpress
Related
While writing a Jinja2 template for MkDocs, I need some processing that is not covered by the filters/tests available (specifically, I need date formatting, which is a recurring example for custom filters in Jinja2-related resources across the Web). How can I define my own filters/tests and use them from templates?
To clarify the question, I know how to register new filters/tests in a Jinja2 environment from Python. My issue is that, as a user of MkDocs, I do not configure Jinja2 myself. So what I’m looking for is a way to hook into the setup that MkDocs performs.
I assume it is possible to add filters from a plugin. In fact, I have found one such plugin (undocumented and apparently not under active development, unfortunately). However, I hope that there is a simpler, local solution; one that would not involve implementing a plugin, packaging it as a Python package and publishing it on PyPi.
A possible solution is to use mkdocs-simple-hooks that allows to implement the hooks without needing to create a plugin. For example in your case:
plugins:
- mkdocs-simple-hooks:
hooks:
on_env: "docs.hooks:on_env"
docs/hooks.py
def on_env(env, config, files, **kwargs):
env.filters['my_filter'] = my_filter
env.tests['my_test'] = my_test
return env
I was trying to create documentation from python doc strings, and found pdoc. If you don't know, it creates html documentation from python doc strings. Since it generates .html files and not .rst, how do I publish those to ReadTheDocs or generate .rst files using pdoc?
Quick sidenote: I don't want to use sphinx since 1) the theme pdoc has is pretty cool and 2) I don't know how to generate documentation from docstrings using sphinx (all the tutorials I looked at didn't help).
Read the Docs released a beta feature some time ago that allows you to completely override the build process. This means that you can execute custom commands (e.g. pdoc) and output all the HTML to a particular directory (_readthedocs/html). Once the build is finished, Read the Docs will publish the content of that directory.
Check out the documentation at https://docs.readthedocs.io/en/stable/build-customization.html#override-the-build-process
In newer Wordpress, there is REST-API in the core.
Previously used plugin (specifically WP-API-1.2.3) had different API base URL (e.g. /wp-json/posts), but the newer one is using different structure (e.g. /wp-json/wp/v2/posts).
In order to be backward compatible, I want to support older version and not changing the base of API - otherwise, all other pages using this service would no longer work.
I found how to change the "wp-json" part, but not namespace "/wp/v2/".
Is there a way around how to use the original base path and in the best case to be sure nothing will go wrong to use the older library instead of the newer core functionality?
Disabling it in functions.php can't solve this issue - it's shutting down the lib.
add_filter('json_enabled', '__return_false');
add_filter('json_jsonp_enabled', '__return_false');
Thanks
Basically, there were 2 things I did and it's working:
rest_url_prefix was the same like in previous version (wp-json), paths were writing over each other (after requesting something like wp-json/posts went through the new core part of WP, not the lib).
function rest_get_url_prefix() {
return apply_filters( 'rest_url_prefix', 'newPrefix' );
}
I didn't click on Settings -> Permalinks -> Save changes
By doing this I am now able to use the original endpoints
Normally I always install some extension by using composer , but now I need to use Barcode Generator library
http://www.barcodebakery.com/en
In order to use their library I need to
require_once('class/BCGFontFile.php');
require_once('class/BCGColor.php');
require_once('class/BCGDrawing.php');
but I don't know what is the best practice to do it with yii2
Please help!!!
Like in this doc
Yii relies on the class autoloading mechanism to locate and include
all required class files. It provides a high-performance class
autoloader that is compliant with the PSR-4 standard. The autoloader
is installed when you include the Yii.php file.
Then for your requirement the best pratice you are looking for is described in the doc mentioned above.
I'm a little confused about this, even though I have read all of the API and searched for hours.
When I activate my plugin I add some values to the options database, e.g.
add_option('code','24');
How do I update that value or use it in the widget? I only see "instances" now, like the example on this page:
http://wpcoderz.com/creating-a-multi-instance-widget-with-wordpress-2-8/
You can get an option using get_option and update it using update_option. But you should use instances instead of options for widget settings (like title) because that's the purpose of instances. You don't have to care about storing instance value - WP does it for you. If you don't understand instances well, look at codex.wordpress.org/Widgets_API.