I don't normally do releases of my code. Whatever is on Github is what works and what I use to work with the code. There are times when a release of code at specific development milestones is necessary for example when you'd like people to beta test or when it's ready for a 1.0 release. This is a description of my basic process to commit code and create a tag. I can then go in to Github and create a release based on the tags. Committing code The first step is to commit the code. I use the command line...
As far as I know, unless you put your themes and plugins in the directories, you can't update themes and plugins through the admin interface, you'll have to delete them and upload them again. git-updaterhttps://github.com/caraya/rivendellweb-wptheme provides a mechanism to update plugins and themes from a Git repository Github, GitLab or BitBucket without having to publish them. Download the plugin and upload it to your WordPress installation or install it directly from your WordPress admin plugin interface. Before we can install our code using the plugin we need to add a header in the style.css header or in the plugin's header...
One thing I've always tried to do is lint my PHP code as I go when working with WordPress so it won't bite me later if I try to submit the theme or plugin to the WordPress repositories. The best, and as far as I know only, way to efficiently lint PHP code is with PHP Code Snifferhttps://github.com/squizlabs/PHPCodeSniffer and the WordPress ruleshttps://github.com/squizlabs/PHPCodeSniffer to accompany it. The process includes installing PHP Code sniffer, optionally creating a configuration file, and running the code, either from the command line or from an existing build file. Installation Methods There are many ways to install...
In the last posthttps://publishing-project.rivendellweb.net/docs-as-code-the-technical-side/ we discussed the basic setup of a barebones Vuepress site. This post will cover some basic details of the theme: the navigation menu and the sidebar. To create the configuration you need to create the directory where Vuepress stores its data. From the root of the site create a .vuepress directory. bash mkdir -p /docs/.vuepress/ Inside the .vuepress directory, create a config.js file. The rest of the work will be done in this file. The first part of the module export declaration defines some basic metadata for the site. The head array will contain a list...
Docs as code is an interesting way to create documentation for software and technical projects. The idea is that we use the same tools to create our documentation that engineers or technical authors use to create their projects. According to Write the Docshttps://www.writethedocs.org/guide/docs-as-code/: Documentation as Code Docs as Code refers to a philosophy that you should be writing documentation with the same tools as code: - Issue Trackers - Version Control Git - Plain Text Markup Markdown, reStructuredText, Asciidoc - Code Reviews - Automated Tests This means the technical writing process follows the same workflows as the rest of the...
The last two articles on using Axios with the WordPress REST API has worked with standard items in the WordPress world like post and pages. WordPress also gives you the option of creating your own content types with Custom Post Typeshttps://wordpress.org/support/article/post-types/ CPTs We create custom post types in PHP, either in a theme's functions.php or in a plugin. When working with the REST API, the important configuration is showinrest. Specifying this attribute with a value of true will make the custom post type available in the WordPress API. The CPT definition for an essay CPT looks like this: php array...
As I'm learning the deep workings of the WordPress REST APIhttps://developer.wordpress.org/rest-api/ I'm also learning how to use Axioshttps://github.com/axios/axios as a replacement for Fetch. While I discovered that this will not work with Nuxt and the WordPress REST API, it's still a good starting point if you want to work with vanilla JS and templating engines. I am still researching how to make it work in Nuxt.js. Another thing that's important to note. Other than getJWT all other functions require authentication and I've chosen to use JSON Web Tokens JWThttps://jwt.io/introduction to authenticate the requests. The WordPress site uses the JWT Authentication...
While researching block-based themes I found more information about blocks themselves and how to write them in a way you can submit them for inclusion in the WordPress directory. Most, if not all our blocks, will not be dynamic so we won't cover them in this post, just mention them in case that's what you're looking for. See creating dynamic blockshttps://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/creating-dynamic-blocks/ for more information Creating blocks with external metadata The block type metadatahttps://developer.wordpress.org/block-editor/developers/block-api/block-metadata/ provides an external means to declare our block API that will also be necessary if you decide to submit it to the block directoryhttps://wordpress.org/support/article/block-directory/. The metadata is...
Note Right now block-based themes and full site editing are still work in progress. I write about it because, sooner rather than later, themes will take advantage of full site editing and they will become a new tool in the arsenal for WordPress developers. These features are not part of Core WordPress, they require the latest Gutenberg plugin not the version that is bundled with WordPress, and the APIs discussed in this post may change before they are merged into core and become official parts of WordPress. An experimental feature available in recent versions of Gutenberg is the ability to...
There are times when we want the same element across the page to do the same. The following block styles the h2 elements inside the header, footer and main elements. css header h2, main h2, footer h2 { color: red; } It works but it's error-prone, repetitive and may cause all rules to be ignored if there is a mistake. Published in Selectors Level 4https://drafts.csswg.org/selectors-4/matches-pseudo, the :is pseudo-classhttps://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classestakes a selector list and selects any element that matches any of the selectors in that list. Using :is e can write the previous example like this css :isheader, main, footer h2 {...