Adding Custom CSS with PHP

I know this sounds like it’s a good idea, but anyone can simply just view the source of the page and take whatever they want from there. They can also simply just hit Ctrl+S on their keyboard and save that entire page to their hard drive. They could even screenshot the page and use OCR technology to simply pull the text out if they wanted to. There’s also Photoshop.

In my opinion, this is a waste of time.

With that out of the way, you could start by looking here: https://codex.wordpress.org/Writing_a_Plugin

That will cover a lot of important aspects of creating a plugin.

Then, to understand the most simplest form of a plugin, have a look at the hello.php (Hello Dolly plugin) file in your WordPress’ wp-content/plugins/ directory. Changing that will allow you to achieve what you want.

If you simply want to add this to your own site, you can do this in the footer:

<?php
    echo '<style>body {
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
}</style>';
?>